SPRUHX5I August 2014 – May 2024 TMS320F28374S , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376S , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378S , TMS320F28379S
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 200MHz, then the acquisition window duration must be 100ns/5ns = 20 SYSCLK cycles. The ACQPS field must be set to 20 - 1 = 19.
AdcaRegs.ADCSOC5CTL.bit.CHSEL = 1; //SOC5 converts ADCINA1
AdcaRegs.ADCSOC5CTL.bit.ACQPS = 19; //SOC5 uses a sample duration of 20 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).