This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi!.....
Here is a problem that is boring me a lot...
I've done a simple V/Hz control for an induction machine, but when I launch the execution through debugger, the code stops immediately on the instruction "interrupt void ILLEGAL_ISR(void)"
this is the code of the main ADC interrupt.....if I try to remove some lines, for example if I comment "ADC_converter.read();" then the program flows normally!!.....
interrupt void ADCInterrupt(void)
{
ADC_converter.read();
ADC_converter.ImeasA -= (int16)offset1;
ADC_converter.ImeasB -= (int16)offset2;
clarke.As = _IQ15toIQ((int32)ADC_converter.ImeasA);
clarke.Bs = _IQ15toIQ((int32)ADC_converter.ImeasB);
clarke.calc(&clarke);
VHz_profile.Freq = _IQ15toIQ((int32)ADC_converter.Ref_Pot);
VHz_profile.calc();
modulator_MF.Gain = VHz_profile.VoltOut;
modulator_MF.Freq = VHz_profile.Freq;
modulator_MF.Offset = 0;
modulator_MF.calc();
pwm1.MfuncC1 = (int16)_IQtoIQ15(modulatore_MF.Ta);
pwm1.MfuncC2 = (int16)_IQtoIQ15(modulatore_MF.Tb);
pwm1.MfuncC3 = (int16)_IQtoIQ15(modulatore_MF.Tc);
pwm1.update(&pwm1);
PwmDacCh1 = (int16)_IQtoIQ15(modulatore_MF.Alpha);
PwmDacCh2 = (int16)_IQtoIQ15(modulatore_MF.Ta);
PwmDacCh3 = (int16)_IQtoIQ15(modulatore_MF.Tb);
pwmdac1.update(&pwmdac1);
t_fir_filter = 1;
flag_interrupt = 1;
f_1msec = 1;
// Enable more interrupts from this timer
EPwm1Regs.ETCLR.bit.INT = 1;
// Acknowledge interrupt to receive more interrupts from PIE group 3
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
}
Does anybody have any clue on what is happening? Maybe some stack overflow? (Anyway stack size is 0x200 and I tried also 0x400 with no result...)
thank U.....!.......
samuele
Hi samuele,
Take a look into these post.
http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/40471/144406.aspx#144406
http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/139589/503092.aspx#503092
http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/140669/510823.aspx#510823
Regard,s
Thirumoorthy.R
If my reply answers your question please click on the green button "Verify Answer"
Thank you Thirumoorthy
I tried some tricks that I found in the posts you suggested, anyway I cannot solve the issue...
case1) I put a breakpoint on the first instruction of the ADC interrupt (I have only 1 interrupt) and run: program stops with illegal trap (so, ADC interrupt is never serviced);
case2) I set the program counter to the last instruction of the main() before the idle loop: no problem, then I can go in single step forever. I can even put a breakpoint inside the ADC interrupt code and run: the program stops correctly on that instruction, and I can repeat this forever. But If I remove the breakpoint and run the program, it stops instantly on the illegal trap.
case3)I remove the breakpoint and reset CPU, than I set the PC on the first instruction of the ADC interrupt: program stops with illegal trap and this message is output: "Trouble removing breakpoint with the action "Terminate Gel_Go()" at 0x80CE".
To be honest, I cannot understand!!
ps, when the execution stops with illegal trap, stack pointer is 0x34, so I think I can exclude a problem concerning stack overflow (stack size is 0x200)
I'm a "little" confused :-)
any suggestion is welcome!
samuele