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.

LAUNCHXL-F28379D: Questions about ADC interrupt

Part Number: LAUNCHXL-F28379D

I am looking at the example adc_soc_epwm_cpu01.c 

I am confused about the interrupt. In the example, it calls ADCA1 interrupt to read results for A0 pin.

So I wonder can ADCA1 interrupt be used for reading results for other pins (i.e. ADCINC3) as well. Also, can I use ADCB1, ADCC1 or ADCD1 interrupt to read pin A0? 

First I thought the interrupt ISR name has to match the ADC name, but it seems like ADCx1 just matters to the priority. 

  • Hi Tom,

    Each ADC has 4 interrupts: 1 to 4. These interrupts can only be triggered by the corresponding ADC (e.g. interrupt ADCA1 can only be triggered by ADCA). However, there is no correlation between ADC input channel A1 and ADC A interrupt 1. Any ADCA SOC can trigger int flag 1 to be set (e.g. SOC12 on ADCA can trigger ADC interrupt flag 1, SOC1 on ADCA can trigger ADC interrupt flag 4). Any SOC can sample and channel connected to that ADC (e.g. ADCA SOC0 can sample ADCINA3 input).

    There is no limitation to what samples you read inside a given ISR, even from different ADCs (you just need to make sure the samples are ready). e.g. if you use SOC0 on all 4 ADCs all triggered by the same ePWM event, you don't need 4 ISRs to read the results. Instead, you should pick SOC0 on one of the 4 ADCs to trigger an interrupt. Because all 4 ADCs had 1 sample to convert and all started at the same time, you can read RESULT0 from all 4 ADCs in the ISR (regardless of which ADC you chose to trigger it). Note that the PIE location will change depending on which ADC and flag you select.