Other Parts Discussed in Thread: CONTROLSUITE
My code is for main() is given below:
#include "F28x_Project.h" // Device Header File and Examples Include File #include "sgen.h" #define SIGNAL_LENGTH 512 /* Create an instance of Signal generator module */ SGENT_1 sgen = SGENT_1_DEFAULTS; #pragma DATA_SECTION(v, "SGENipcb"); int v[SIGNAL_LENGTH]; int xn,yn,i; // external function prototypes extern void InitSysCtrl(void); extern void InitPieCtrl(void); extern void InitPieVectTable(void); // Prototype statements for functions found within this file. void Gpio_select(void); void Setup_ePWM1(void); void Setup_ePWM2(void); interrupt void ePWM_compare_isr(void); void main(void) { InitSysCtrl(); // Basic Core Init from SysCtrl.c EALLOW; //SysCtrlRegs.WDCR= 0x00AF; // Re-enable the watchdog EDIS; // 0x00AF to NOT disable the Watchdog, Prescaler = 64 DINT; // Disable all interrupts Gpio_select(); // setting for ePWM Outputs Setup_ePWM1(); // init of ePWM1A and ePWM1B Setup_ePWM2(); // init of ePWM2A and ePWM2B InitPieCtrl(); // basic setup of PIE table; from PieCtrl.c InitPieVectTable(); // default ISR's in PIE ; from PieVect.c EALLOW; PieVectTable.32 = &ePWM_compare_isr; EDIS; //ENABLING ADC INERRUPT PieCtrlRegs.PIEIER1.bit.INTx6 = 1; IER |=1; // enable INT1 FOR ADC EINT; ERTM; // Sync ePWM EALLOW; CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1; EDIS; // Start ePWM EPwm2Regs.TBCTL.bit.CTRMODE = 0; // Un-freeze and enter up-count mode //while(1) //{ //} }
The only Error #66 expected a ";" appears on the this line while building:
Line 48: PieVectTable.32 = &ePWM_compare_isr;
And the content inside interrupt void ePWM_compare_isr(void) is this:
sgen.offset=1;
sgen.gain=0x7fff; // gain=1
sgen.freq=5369; // freq = 50Hz
sgen.step_max=1000; /* Max Freq= (step_max * sampling freq)/65536 */
sgen.alpha=8192; /* phase_norm =(pi/4/(2*pi))*2^16=8192 */
for(i=0;i<SIGNAL_LENGTH;i++)
{
v[i]=0;
}
for(i=0;i<SIGNAL_LENGTH;i++)
{
sgen.calc(&sgen);
xn=sgen.out;
v[i]=xn;
EPwm1Regs.CMPA.bit.CMPA = v[i] ;
EPwm2Regs.CMPA.bit.CMPA = v[i] ;
}
// Return from interrupt
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; // Clear ADC INT1 flag
// Acknowledge this interrupt to receive more interrupts from group 3
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Acknowledge interrupt to PIE
}
This function is made outside of main. And I searched for this solution on this forum already but I couldn't find a solution for my problem
Console Window for this program is this:
_________________________________________________________________________________
**** Build of configuration Debug for project Lab3_cpu01 ****
"C:\\ti\\ccsv7\\utils\\bin\\gmake" -k all
'Building file: "../new_open_loop_WD_off_ADC_interrupt.c"'
'Invoking: C2000 Compiler'
"C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.6.LTS/bin/cl2000" -v28 -ml -mt --vcu_support=vcu2 --tmu_support=tmu0 --cla_support=cla1 --float_support=fpu32 --opt_for_speed=2 --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.6.LTS/include" --include_path="C:/ti/controlSUITE/libs/dsp/SGEN/v101/include" --include_path="C:/F2837xD/Device_support/F2837xD_headers/include" --include_path="C:/F2837xD/Device_support/F2837xD_common/include" -g --define=CPU1 --define=_LAUNCHXL_F28379D --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="new_open_loop_WD_off_ADC_interrupt.d_raw" "../new_open_loop_WD_off_ADC_interrupt.c"
>> Compilation failure
subdir_rules.mk:72: recipe for target 'new_open_loop_WD_off_ADC_interrupt.obj' failed
"../new_open_loop_WD_off_ADC_interrupt.c", line 48: error #66: expected a ";"
1 error detected in the compilation of "../new_open_loop_WD_off_ADC_interrupt.c".
gmake: *** [new_open_loop_WD_off_ADC_interrupt.obj] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
_______________________________________________________
Thanks in advance,