SPRUJ53B April 2024 – September 2024 TMS320F28P550SJ , TMS320F28P559SJ-Q1
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 150MHz, then the acquisition window duration must be 100ns/6.667ns = 15 cycles. The ACQPS field must be set to 15 - 1 = 14.
AdcaRegs.ADCSOC5CTL.bit.CHSEL = 1; //SOC5 converts ADCINA1
AdcaRegs.ADCSOC5CTL.bit.ACQPS = 14; //SOC5 uses a sample duration of 15 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 15.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 15.12 for exact sample, conversion, and result latch timings).