Basic Operation
868
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Analog To Digital Converter (ADC) Module
22.2.3 ADC Module Basic Interrupts
This section describes the basic interrupts generated by the ADC module.
22.2.3.1 Group Conversion End Interrupt
The ADC module sets the group’s conversion end flag (EV_END, G1_END, or G2_END) in that group’s
interrupt flag register (ADEVINTFLG, ADG1INTFLG, ADG2INTFLG) when all the channels selected for
conversion in that group are converted. This causes a group conversion end interrupt to be generated if
this interrupt is enabled by setting the group’s END_INT_EN control bit (EV_END_INT_EN,
G1_END_INT_EN, or G2_END_INT_EN).
This interrupt can be easily used for conversion groups configured to be in the single-conversion mode.
The application program can read out the conversion results, change the group’s configuration if
necessary, and restart the conversions by triggering the group from within the interrupt service routine.
For groups configured to be in continuous conversion mode, this interrupt condition is not practical as the
conversions are always in progress. In this case, the Group Memory Threshold Interrupt is more practical
as the application can allow a programmable number of conversion results to accumulate before
interrupting the CPU.
22.2.3.2 Group Memory Threshold Interrupt
The ADC module has the ability to generate an interrupt for a fixed number of conversions for each group.
A group memory threshold register determines how many conversion results must be in a group’s memory
region before the CPU is interrupted. This feature can be used to significantly reduce the CPU load when
using interrupts for reading the conversion results.
The group’s threshold register needs to be configured before the group conversions are triggered. This
threshold register value behaves like a down-counter, which decrements each time the ADC writes a
conversion result to this group’s memory. This counter is incremented each time the application program
reads a conversion result from the results’ memory by accessing the FIFO queue. Simultaneous read (by
application program) and write (by ADC module) operations from the group’s results’ memory leave the
threshold counter unchanged.
The threshold counter can decrement past 0 and become negative. It always increments back to its
original value when the memory region is emptied. To determine how many samples are in the memory
region at a given moment, the threshold counter can be subtracted from the originally configured threshold
count.
Whenever the threshold counter transitions from +1 to 0, it sets the group’s threshold interrupt flag, and
the CPU is interrupted if the group’s threshold interrupt is enabled. The CPU is expected to clear the
interrupt flag after reading the conversion results from the memory.
The interrupt flag is not set when the threshold counter stays at 0 or transitions from -1 to 0.
22.2.3.3 Group Memory Overrun Interrupt
An interrupt can be generated for each group if the number of ADC conversions for that group exceed the
number of buffers allocated for that conversion group. The application program can choose to read out all
the conversion results using the CPU or the DMA. Alternatively, the application program can set the
group’s OVR_RAM_IGN bit and allow the ADC module to overwrite the group’s results’ memory contents
with new conversion results.