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.

TMS320F280025C: Disable ADC interrupt temporarily

Part Number: TMS320F280025C


Hi expert,

I have a problem, in order to perfect my system including a control loop, I would like to temporarily deactivate my ADC interrupt, I explain:
My transistor control pwm works at a frequency of 40kHz and I have among others an ADC interrupt which works at 320kHz because I do a digital averaging on 8 points.

My regulation interrupt works at 20kHz in order to try to have a minimum of time to do everything (it's complicated anyway). Once the averaging is done in the ADC interrupt I would like to deactivate it and come back to it only during the next regulation interrupt in order to give me time.


My question is how to deactivate a particular interrupt? I tried the command Interrupt_disable(INT_ADCA1) but it doesn't work.

Can you help me please ?

Thanks 

Damien

  • Hello Damien,

    To disable an ADC interrupt, use the ADC_disableInterrupt() function.

    For example:

    // Disable ADCA INT1
    ADC_disableInterrupt(ADCA_BASE, ADC_INT_NUMBER1);
    // Perform processing
    // ...
    // Enable ADCA INT1
    ADC_enableInterrupt(ADCA_BASE, ADC_INT_NUMBER1);
    

    Best regards,
    Ibukun

  • Hello Damien,

    Just came back to this thread. Want to add:

    If you are oversampling over 8 samples, there are other options depending on how many SOCs you are using up. Instead of triggering an interrupt every time, you could configure 8 consecutive SOCs to sample the same channel in a burst, and only trigger the interrupt on the last SOC. So, in your case you could configure SOC priority to make SOCs 8-15 round-robin and the others high priority and enable burst mode with a size of 8. The burst would be triggered by your PWM. When the burst conversion is triggered, SOCs 8-15 are triggered back-to-back, and then an interrupt is triggered at 15. This saves you the trouble of having to disable interrupts and also saves you processing cycles.

    Of course, this is contingent on you having that many SOCs unused on the ADC module.