Other Parts Discussed in Thread: C2000WARE
Hi,
In my application , i need to creating a continuous stream of conversions with one adc channel, then do a continuous stream of other adc channel
ADCINA0 --SOC0 SOC1 SOC2 SOC3,
ADCINA1 --SOC4 SOC5 SOC6 SOC7,
AdcRegs.INTSEL1N2.bit.INT1E = 1; //Enable ADCINT1
AdcRegs.INTSEL1N2.bit.INT1CONT = 1; //enable ADCINT1 Continuous mode
AdcRegs.INTSEL1N2.bit.INT1SEL = 1; //setup EOC1 to trigger ADCINT1 to fire
AdcRegs.ADCSOC0CTL.bit.CHSEL = 0; //set SOC0 channel select to ADCINA0
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //set SOC0 start trigger on EPWM1A
AdcRegs.ADCINTSOCSEL1.bit.SOC0 = 1; //ADCINT1 will trigger SOC0
Cla1Regs.MPISRCSEL1.bit.PERINT1SEL = CLA_INT1_ADCINT1; //CLA task1 Response to ADCINT1
SOC0-SOC3 have same config.
SOC4-SOC7 take the same way ,except use ADCINT2, and adc trigger source is EPWM2A, exe CLAtask2;
Through the above configuration,when EPWM1A triggers, SOC0-3 convert in a continuous stream mode.When enough samples are taken,set a cla isr flag, CPU response interrupt and config for SOC4-SOC7 then EPWM2A trigger ADC convert .
The alternate sampling of channel ADCINA0 and channel ADCINA1 is realized,
1. Is this method ok?
2.Is there any other way to make it easier?
2.Whether it can be realized without CPU interrupt?
thanks in advance.