SPRUJD3A July 2025 – October 2025 F28E120SB , F28E120SC
To configure ADCA to perform a single conversion on channel ADCIN1 when the MCPWM timer reaches the period match, a few things are necessary. First, MCPWM3 must be configured to generate an SOCA, SOCB, SOCC, or SOCD signal (in this statement, SOC refers to a signal in the MCPWM module). See the Multi-Channel Pulse Width Modulator Module (MCPWM) 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 160MHz, then the acquisition window duration must be 100ns/6.25ns = 16 cycles. The ACQPS field must be set to 0 in the upper two bits and 16 - 1 in the lower six bits (ACQPS[7:6] = 0, ACQPS[5:0]=15)..
AdcaRegs.ADCSOC5CTL.bit.CHSEL = 1; //SOC5 converts ADCINA1
AdcaRegs.ADCSOC5CTL.bit.ACQPS = 15; //SOC5 uses a sample duration of 16 SYSCLK cycles
AdcaRegs.ADCSOC5CTL.bit.TRIGSEL = 14; //SOC5 begins conversion on PWM3 SOCB
As configured, when MCPWM3 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 12.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 12.11 for exact sample, conversion, and result latch timings).