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.

[F28035] Multi-Axis Motor Control EVM - Lab1 Trapped in ISR_ILLEGAL

Other Parts Discussed in Thread: CONTROLSUITE

Hi C2K Champs,

 I'm working through the 2010-TIC2000-MotorControl-Workshop-Labsv1.0 Lab found in <install directory>controlSUITE\development_kits\LVMultiAxis+PfcKit_v1.4\~Docs and in Lab 1 after setting the BUILDLEVEL LEVEL1 and programming nothing happens.

Stepping through the code reveals that it is getting trapped in "void ISR_ILLEGAL(void)   // Illegal operation TRAP" when it gets to // Initialize ADC module ADC_MACRO_INIT() Macro.


Commenting out this macro enables motor one to beginning spinning.

// Initialize ADC module
//ADC_MACRO_INIT()
 
Why would that macro through an exception. Is standard operating procedure?  This is not documented in the manual.
 

Also note, that the instruction to change EnableFlag has no effect if you do not uncomment the following  on line 195 of 2xPM_Sensorless.c

// Waiting for enable flag set
 while (EnableFlag==FALSE)
    {
      BackTicker++;
    }
InstaSpin EVM:
Low Voltage Multi-Axis Motor Control and PFC Developers Kit (v1.4) Part Number: TMDS1MTRPFCKIT
Thanks!
  • Since it was getting stuck on a Macro i couldn't step through the code.  After replacing the macro with with its actual code (included below) found in F2802x_Adc it turned out that the DELAY_US(ADC_usDELAY); was causing it to go into never never land.  Commenting these lines out resulted in the ADC successfully being inited.

    I am curious to know what caused DELAY_US to through an interrupt and if removing these delays could cause any incorrect performance in the ADC.

    ADC_MACRO_INIT Code:
     
    //DELAY_US(ADC_usDELAY);
    AdcRegs.ADCCTL1.all=ADC_RESET_FLAG; \
    asm(" NOP "); \
    asm(" NOP ");    \
     
    EALLOW; \
    AdcRegs.ADCCTL1.bit.ADCBGPWD = 1; /* Power up band gap */ \
    //DELAY_US(ADC_usDELAY); /* Delay before powering up rest of ADC */
    AdcRegs.ADCCTL1.bit.ADCREFSEL = 0; \
    AdcRegs.ADCCTL1.bit.ADCREFPWD = 1; /* Power up reference */ \
    AdcRegs.ADCCTL1.bit.ADCPWDN = 1; /* Power up rest of ADC */ \
    AdcRegs.ADCCTL1.bit.ADCENABLE = 1; /* Enable ADC */ \
    asm(" RPT#100 || NOP"); \

    AdcRegs.ADCCTL1.bit.INTPULSEPOS=1; \
    AdcRegs.ADCCTL1.bit.TEMPCONV=0; \
    //DELAY_US(ADC_usDELAY);
        \
    /******* CHANNEL SELECT *******/ \
        \
        \
    AdcRegs.ADCSOC0CTL.bit.CHSEL = 0;   /* ChSelect: ADC A0-> Motor1 Phase A*/ \
    AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; /* Set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1*/ \
    AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; /* Set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)*/ \
        \
    AdcRegs.ADCSOC1CTL.bit.CHSEL = 1; /* ChSelect: ADC A1-> Motor1 Phase B*/ \
    AdcRegs.ADCSOC1CTL.bit.TRIGSEL  = 5; \
    AdcRegs.ADCSOC1CTL.bit.ACQPS = 6; \
        \
    AdcRegs.ADCSOC2CTL.bit.CHSEL = 11; /* ChSelect: ADC B3-> DC Bus Voltage*/ \
    AdcRegs.ADCSOC2CTL.bit.TRIGSEL  = 5; \
    AdcRegs.ADCSOC2CTL.bit.ACQPS = 6; \
        \
    AdcRegs.ADCSOC3CTL.bit.CHSEL = 4;    /* ChSelect: ADC A4-> Motor2 Phase A*/ \
    AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 5; \
    AdcRegs.ADCSOC3CTL.bit.ACQPS = 6; \
        \
    AdcRegs.ADCSOC4CTL.bit.CHSEL = 8; /* ChSelect: ADC B0-> Motor2 Phase B*/ \
    AdcRegs.ADCSOC4CTL.bit.TRIGSEL  = 5; \
    AdcRegs.ADCSOC4CTL.bit.ACQPS = 6; \
                   \
    EDIS; \
        \
        \

           

    /* Set up Event Trigger with CNT_zero enable for Time-base of EPWM1 */ \
    EPwm1Regs.ETSEL.bit.SOCAEN = 1;     /* Enable SOCA */ \
    EPwm1Regs.ETSEL.bit.SOCASEL = 1;    /* Enable CNT_zero event for SOCA */ \
    EPwm1Regs.ETPS.bit.SOCAPRD = 1;     /* Generate SOCA on the 1st event */ \
    EPwm1Regs.ETCLR.bit.SOCA = 1;       /* Clear SOCA flag */