写了一个三相SPWM的程序,之前的CCS6.0没升级的时候可以编译,之后升级了编译器就不能编译了!
报错 如下:
Description Resource Path Location Type
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 317 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 211 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 227 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 197 C/C++ Problem
关于第二路的初始化程序如下:
void InitEPwm2Example()
{
EPwm2Regs.TBPRD = EPWM2_TIMER_TBPRD; // Set timer period
EPwm2Regs.TBPHS.half.TBPHS = 0x0000; // Phase is 0
EPwm2Regs.TBCTR = 0x0000; // Clear counter
// Setup compare
EPwm2Regs.CMPA.half.CMPA = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
EPwm2Regs.CMPB = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
// Setup TBCLK
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; // Load registers every ZERO
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;
// Set actions
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; // Clear PWM1A on CAU
EPwm2Regs.AQCTLA.bit.CAD = AQ_SET; // Set PWM1A on CAD
EPwm2Regs.AQCTLB.bit.CAU = AQ_SET;
EPwm2Regs.AQCTLB.bit.CAD = AQ_CLEAR;
// Active Low PWMs – Setup Deadband
EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE;
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;
EPwm2Regs.DBCTL.bit.IN_MODE = DBA_ALL;
EPwm2Regs.DBRED = EPWM3_DEADBAND;
EPwm2Regs.DBFED = EPWM3_DEADBAND;
// Interrupt where we will change the Deadband
EPwm2Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; // Select INT on Zero event
EPwm2Regs.ETSEL.bit.INTEN = 1; // Enable INT
EPwm2Regs.ETPS.bit.INTPRD = ET_1ST; // Generate INT on 1st event
}
附加说明:
1.在EPwm2Regs这个寄存器上按F3可以转到 DSP2803x_GlobalVariableDefs.c
2.工程中已经包含了DSP2803x_EPwm.c文件
3.Epwm1和Epwm2的设置完全一样但是没报错
求大神指导!刚刚入门!如果太弱智还请大家谅解哈哈哈
Martin Yu:
看错误提示应该是文件的路径错误,是不是你移动了工程的位置或其他内容?跟编译器相关的路劲不会包含PWM等这些功能模块的头文件的。
写了一个三相SPWM的程序,之前的CCS6.0没升级的时候可以编译,之后升级了编译器就不能编译了!
报错 如下:
Description Resource Path Location Type
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 317 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 211 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 227 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 197 C/C++ Problem
关于第二路的初始化程序如下:
void InitEPwm2Example()
{
EPwm2Regs.TBPRD = EPWM2_TIMER_TBPRD; // Set timer period
EPwm2Regs.TBPHS.half.TBPHS = 0x0000; // Phase is 0
EPwm2Regs.TBCTR = 0x0000; // Clear counter
// Setup compare
EPwm2Regs.CMPA.half.CMPA = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
EPwm2Regs.CMPB = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
// Setup TBCLK
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; // Load registers every ZERO
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;
// Set actions
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; // Clear PWM1A on CAU
EPwm2Regs.AQCTLA.bit.CAD = AQ_SET; // Set PWM1A on CAD
EPwm2Regs.AQCTLB.bit.CAU = AQ_SET;
EPwm2Regs.AQCTLB.bit.CAD = AQ_CLEAR;
// Active Low PWMs – Setup Deadband
EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE;
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;
EPwm2Regs.DBCTL.bit.IN_MODE = DBA_ALL;
EPwm2Regs.DBRED = EPWM3_DEADBAND;
EPwm2Regs.DBFED = EPWM3_DEADBAND;
// Interrupt where we will change the Deadband
EPwm2Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; // Select INT on Zero event
EPwm2Regs.ETSEL.bit.INTEN = 1; // Enable INT
EPwm2Regs.ETPS.bit.INTPRD = ET_1ST; // Generate INT on 1st event
}
附加说明:
1.在EPwm2Regs这个寄存器上按F3可以转到 DSP2803x_GlobalVariableDefs.c
2.工程中已经包含了DSP2803x_EPwm.c文件
3.Epwm1和Epwm2的设置完全一样但是没报错
求大神指导!刚刚入门!如果太弱智还请大家谅解哈哈哈
Kefan Yu:
回复 Martin Yu:
我试过删除这个工程文件然后重新Import了一个EPwmDeadband的工程,然后把代码粘进去还是不可以。
我还安了一个ubuntu,在这上面安了一个ccs6.1也是这个问题。
在别的同学电脑上的ccs5上就可以编译哈哈哈好神奇啊
写了一个三相SPWM的程序,之前的CCS6.0没升级的时候可以编译,之后升级了编译器就不能编译了!
报错 如下:
Description Resource Path Location Type
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 317 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 211 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 227 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 197 C/C++ Problem
关于第二路的初始化程序如下:
void InitEPwm2Example()
{
EPwm2Regs.TBPRD = EPWM2_TIMER_TBPRD; // Set timer period
EPwm2Regs.TBPHS.half.TBPHS = 0x0000; // Phase is 0
EPwm2Regs.TBCTR = 0x0000; // Clear counter
// Setup compare
EPwm2Regs.CMPA.half.CMPA = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
EPwm2Regs.CMPB = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
// Setup TBCLK
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; // Load registers every ZERO
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;
// Set actions
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; // Clear PWM1A on CAU
EPwm2Regs.AQCTLA.bit.CAD = AQ_SET; // Set PWM1A on CAD
EPwm2Regs.AQCTLB.bit.CAU = AQ_SET;
EPwm2Regs.AQCTLB.bit.CAD = AQ_CLEAR;
// Active Low PWMs – Setup Deadband
EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE;
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;
EPwm2Regs.DBCTL.bit.IN_MODE = DBA_ALL;
EPwm2Regs.DBRED = EPWM3_DEADBAND;
EPwm2Regs.DBFED = EPWM3_DEADBAND;
// Interrupt where we will change the Deadband
EPwm2Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; // Select INT on Zero event
EPwm2Regs.ETSEL.bit.INTEN = 1; // Enable INT
EPwm2Regs.ETPS.bit.INTPRD = ET_1ST; // Generate INT on 1st event
}
附加说明:
1.在EPwm2Regs这个寄存器上按F3可以转到 DSP2803x_GlobalVariableDefs.c
2.工程中已经包含了DSP2803x_EPwm.c文件
3.Epwm1和Epwm2的设置完全一样但是没报错
求大神指导!刚刚入门!如果太弱智还请大家谅解哈哈哈
囧:
回复 Kefan Yu:
你有添加F2803x_Epwm.h这个文件吗?在加入的头文件里
写了一个三相SPWM的程序,之前的CCS6.0没升级的时候可以编译,之后升级了编译器就不能编译了!
报错 如下:
Description Resource Path Location Type
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 317 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 211 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 227 C/C++ Problem
identifier "EPwm2Regs" is Example_2803xEPwmDeadBand.c /Example_2803xEPwmDeadBand line 197 C/C++ Problem
关于第二路的初始化程序如下:
void InitEPwm2Example()
{
EPwm2Regs.TBPRD = EPWM2_TIMER_TBPRD; // Set timer period
EPwm2Regs.TBPHS.half.TBPHS = 0x0000; // Phase is 0
EPwm2Regs.TBCTR = 0x0000; // Clear counter
// Setup compare
EPwm2Regs.CMPA.half.CMPA = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
EPwm2Regs.CMPB = (Uint32)(TimDiv2+sin(0-2*PI/3)*TimDiv2);
// Setup TBCLK
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; // Load registers every ZERO
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;
// Set actions
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; // Clear PWM1A on CAU
EPwm2Regs.AQCTLA.bit.CAD = AQ_SET; // Set PWM1A on CAD
EPwm2Regs.AQCTLB.bit.CAU = AQ_SET;
EPwm2Regs.AQCTLB.bit.CAD = AQ_CLEAR;
// Active Low PWMs – Setup Deadband
EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE;
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC;
EPwm2Regs.DBCTL.bit.IN_MODE = DBA_ALL;
EPwm2Regs.DBRED = EPWM3_DEADBAND;
EPwm2Regs.DBFED = EPWM3_DEADBAND;
// Interrupt where we will change the Deadband
EPwm2Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO; // Select INT on Zero event
EPwm2Regs.ETSEL.bit.INTEN = 1; // Enable INT
EPwm2Regs.ETPS.bit.INTPRD = ET_1ST; // Generate INT on 1st event
}
附加说明:
1.在EPwm2Regs这个寄存器上按F3可以转到 DSP2803x_GlobalVariableDefs.c
2.工程中已经包含了DSP2803x_EPwm.c文件
3.Epwm1和Epwm2的设置完全一样但是没报错
求大神指导!刚刚入门!如果太弱智还请大家谅解哈哈哈
Kefan Yu:
回复 囧:
添加了啊!好奇怪