SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
While each ADC does not have dual S+H circuits, achieving simultaneous sampling is accomplished by setting the SOC triggers on two or more ADC modules to use the same trigger source. The following example demonstrates simultaneous sampling on 4 ADCs based on an ePWM3 event. ADCINA3, ADCINB5, ADCINC5, and ADCIND2 are sampled. An acquisition window of 20 SYSCLK cycles is used, but different durations are possible.
AdcaRegs.ADCSOC0CTL.bit.CHSEL = 3; //SOC0 convert ADCINA3
AdcaRegs.ADCSOC0CTL.bit.ACQPS = 19; //SOC0 uses sample duration of 20 SYSCLK cycles
AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = 10; //SOC0 begins conversion on ePWM3 SOCB
AdcbRegs.ADCSOC0CTL.bit.CHSEL = 5; //SOC0 convert ADCINB5
AdcbRegs.ADCSOC0CTL.bit.ACQPS = 19; //SOC0 uses sample duration of 20 SYSCLK cycles
AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = 10; //SOC0 begins conversion on ePWM3 SOCB
AdccRegs.ADCSOC0CTL.bit.CHSEL = 5; //SOC0 convert ADCINC5
AdccRegs.ADCSOC0CTL.bit.ACQPS = 19; //SOC0 uses sample duration of 20 SYSCLK cycles
AdccRegs.ADCSOC0CTL.bit.TRIGSEL = 10; //SOC0 begins conversion on ePWM3 SOCB
AdcdRegs.ADCSOC0CTL.bit.CHSEL = 2; //SOC0 convert ADCIND2
AdcdRegs.ADCSOC0CTL.bit.ACQPS = 19; //SOC0 uses sample duration of 20 SYSCLK cycles
AdcdRegs.ADCSOC0CTL.bit.TRIGSEL = 10; //SOC0 begins conversion on ePWM3 SOCB
When the ePWM3 trigger is received, all 4 ADCs begin converting in parallel immediately. All results are stored in the ADCRESULT0 register for each ADC. Note that this assumes that all ADCs are idle when the trigger is received. If one or more ADCs is busy, the samples do not happen at exactly the same time.