SPRUHM9H October 2014 – May 2024 TMS320F28075 , TMS320F28075-Q1 , TMS320F28076
To configure ADCA to perform a single conversion on channel ADCIN1 when the ePWM timer reaches the period match, a few things are necessary. First, ePWM3 must be configured to generate an SOCA or SOCB signal (in this statement, SOC refers to a signal in the ePWM module). See the Enhanced Pulse Width Modulator Module (ePWM) chapter on how to do this. Assume that SOCB was chosen.
SOC5 is chosen arbitrarily. Any of the 16 SOCs can be used.
Assuming a 100ns sample window is desired with a SYSCLK frequency of 120MHz, then the acquisition window duration must be 100ns/8.333ns = 12 cycles. The ACQPS field must be set to 12 - 1 = 11.
AdcaRegs.ADCSOC5CTL.bit.CHSEL = 1; //SOC5 converts ADCINA1
AdcaRegs.ADCSOC5CTL.bit.ACQPS = 11; //SOC5 uses a sample duration of 12 SYSCLK cycles
AdcaRegs.ADCSOC5CTL.bit.TRIGSEL = 10; //SOC5 begins conversion on ePWM3 SOCB
As configured, when ePWM3 matches the period and generates the SOCB signal, the ADC begins sampling channel ADCINA1 (SOC5) immediately if the ADC is idle. If the ADC is busy, ADCINA1 begins sampling when SOC5 gains priority (see Section 10.5). The ADC control logic samples ADCINA1 with the specified acquisition window width of 100ns. Immediately after the acquisition is complete, the ADC begins converting the sampled voltage to a digital value. When the ADC conversion is complete, the results are available in the ADCRESULT5 register (see Section 10.12 for exact sample, conversion, and result latch timings).