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.

Never entering ISR :: Real-time RFFT with 12-bit ADC Input Test Example

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I would like to perform a real time FFT on a signal being sampled by the ADC. I imported the relevant example project from TI Control Suite into Code Composer Studio. It compiles fine, but when I run the code it seems the program never enters the interrupt service routine that gets the ADC data. Does anyone have any idea why this may be happening?

Thanks!

  • Hi Mike,

    Which example code are you talking about? Can you indicate the same? Also, have you done any modifications to it?

    Regards,
    Gautam
  • Hi Gautam,

    The code comes from controlSUITE. It's labeled as "F2833x Real FFT with ADC Input (Real-time)".
    Screenshot : postimg.org/.../h9w7e88b5

    I have not made any modifications yet.
  • Ok, got it. Are you checking ADCRESULT0 register under Global Variables while in debug more? Also, I hope you've enabled continuous refresh option.
  • I am checking ADCRESULT0 and I've enabled continuous refresh: postimg.org/.../4goum1jhd
    Is it necessary for me to apply a signal to ADC input A0 in order to have the ADC interrupt? Or is the ADC set to interrupt at a given frequency?
  • Even when no ADC input is fed, you should be able to observe floating results. But do try with some ADC input...

    Also, the variable seems odd... it should look something like this:

    Regards,

    Gautam

  • Well I don't have a function generator at the moment. I found the struct you're referring to, but I still see no results.

  • I got it working by comparing the code to other examples. I had to add this:

    InitPieVectTable();

    and this:

    // Enable ADCINT in PIE
    PieCtrlRegs.PIEIER1.bit.INTx6 = 1;
    IER |= M_INT1; // Enable CPU Interrupt 1
    EINT; // Enable Global interrupt INTM
    ERTM; // Enable Global realtime interrupt DBGM

    // Configure ADC
    AdcRegs.ADCMAXCONV.all = 0x0001; // Setup 2 conv's on SEQ1
    AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x3; // Setup ADCINA3 as 1st SEQ1 conv.
    AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x2; // Setup ADCINA2 as 2nd SEQ1 conv.
    AdcRegs.ADCTRL2.bit.EPWM_SOCA_SEQ1 = 1;// Enable SOCA from ePWM to start SEQ1
    AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1; // Enable SEQ1 interrupt (every EOS)

    // Assumes ePWM1 clock is already enabled in InitSysCtrl();
    EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable SOC on A group
    EPwm1Regs.ETSEL.bit.SOCASEL = 4; // Select SOC from from CPMA on upcount
    EPwm1Regs.ETPS.bit.SOCAPRD = 1; // Generate pulse on 1st event
    EPwm1Regs.CMPA.half.CMPA = 0x0080; // Set compare A value
    EPwm1Regs.TBPRD = 0xFFFF; // Set period for ePWM1
    EPwm1Regs.TBCTL.bit.CTRMODE = 0; // count up and start