Auto-Triggered Conversions - Texas Instruments UCD3138 Technical Reference Manual

Digital power supply controller
Hide thumbs Also See for UCD3138:
Table of Contents

Advertisement

www.ti.com
NOTE: The raw (not averaged) result of AD07 is being read here.
void poll_adc(void)
{
if(AdcRegs.ADCSTAT.bit.ADC_INT == 1) //If the conversion isn't complete
{
adc_values.Vout = AdcRegs.ADCAVGRESULT[0].bit.RESULT;
adc_values.isec = AdcRegs.ADCAVGRESULT[1].bit.RESULT;
adc_values.i_pri = AdcRegs.ADCAVGRESULT[2].bit.RESULT;
adc_values.ishare = AdcRegs.ADCAVGRESULT[3].bit.RESULT; // AD05
adc_values.Vin = AdcRegs.ADCAVGRESULT[4].bit.RESULT;
}
AdcRegs.ADCCTRL.bit.SW_START = 1;
}
Now poll_adc(); can be called from any part of the code that is periodically executed. In this example the
function call is placed in the standard interrupt which is invoked by a timer interrupt in 100µs intervals.
Since conversion of a sequence of 6 measurements will require less than 30µs, the verification of end of
conversion is not really required.
#pragma INTERRUPT(standard_interrupt,IRQ)
void standard_interrupt(void)
{
poll_adc();
}

8.16.3 Auto-Triggered Conversions

A conversion sequence may also be initiated via external triggers without firmware initiation. Sources of
external triggering include the DPWM outputs, the analog comparators and the ADC_EXT_TRIG pin. The
sequencer operation is defined by the external trigger enable bit in the ADC Control Register. The single
sweep bit can set the sequencer in one of two modes, (1) start/stop or (2) continuous conversion on the
external trigger event. Some key points to note:
Only one external trigger can be enabled
A software trigger via the embedded processor is also regarded as a valid trigger
If an external trigger event occurs but the current sequence has not been completed, the event is
skipped until the next trigger event occurs when the sequencer is ready
8.16.4 Continuous Conversions
Here the sequencer is synchronized to a DPWM trigger separated in time. This operating mode is nothing
more than the previous example, but with the sequencer allowed to be re-triggered without being reset to
the initial state of seq00.
Requirement: Auto convert 6 currents (I
SNIU028A – February 2016 – Revised April 2016
Submit Documentation Feedback
adc_values.current_temp = AdcRegs.ADCAVGRESULT[5].bit.RESULT; // AD12
adc_values.temp_sense = AdcRegs.ADCRESULT[6].bit.RESULT;
// trigger anew measurement sequence
,I
,...I
1
2
Figure 8-17.
Copyright © 2016, Texas Instruments Incorporated
) every 100us synchronized to the external trigger.
6
ADC Configuration Examples
// AD01
// AD02
// AD04
// AD05
// AD07
ADC12 Overview
313

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents