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.

Illegal Instruction (TRAP)

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