![Texas Instruments SimpleLink Ethernet MSP432E401Y Technical Reference Manual Download Page 714](http://html1.mh-extra.com/html/texas-instruments/simplelink-ethernet-msp432e401y/simplelink-ethernet-msp432e401y_technical-reference-manual_1095578714.webp)
Functional Description
714
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Analog-to-Digital Converter (ADC)
The temperature sensor reading can be sampled in a sample sequence by setting the TSn bit in the
ADCSSCTLn register. The sample and hold width should be configured for at least 16 ADC clocks using
the ADCSSTSHn register. The temperature reading from the temperature sensor can also be given as a
function of the ADC value. The following formula calculates temperature (TEMP in
℃
) based on the ADC
reading (ADC
CODE
, given as an unsigned decimal number from 0 to 4095) and the maximum ADC voltage
range (VREFP – VREFN) :
TEMP = 147.5 – ((75 × (VREFP – VREFN) × ADC
CODE
) / 4096)
(8)
10.3.7 Digital Comparator Unit
An ADC is commonly used to sample an external signal and to monitor its value to ensure that it remains
in a given range. To automate this monitoring procedure and reduce the amount of processor overhead
that is required, each module provides eight digital comparators.
Conversions from the ADC that are sent to the digital comparators are compared against the user
programmable limits in the ADC Digital Comparator Range (ADCDCCMPn) registers. The ADC can be
configured to generate an interrupt depending on whether the ADC is operating within the low, mid or
high-band region configured in the ADCDCCMPn bit fields. The digital comparators four operational
modes (Once, Always, Hysteresis Once, Hysteresis Always) can be additionally applied to the interrupt
configuration.
10.3.7.1 Output Functions
ADC conversions can either be stored in the ADC Sample Sequence FIFOs or compared using the digital
comparator resources as defined by the SnDCOP bits in the ADC Sample Sequence n Operation
(ADCSSOPn) register. These selected ADC conversions are used by their respective digital comparator to
monitor the external signal. Each comparator has two possible output functions: processor interrupts and
triggers.
Each function has its own state machine to track the monitored signal. Even though the interrupt and
trigger functions can be enabled individually or both at the same time, the same conversion data is used
by each function to determine if the right conditions have been met to assert the associated output.
10.3.7.1.1 Interrupts
The digital comparator interrupt function is enabled by setting the CIE bit in the ADC Digital Comparator
Control (ADCDCCTLn) register. This bit enables the interrupt function state machine to start monitoring
the incoming ADC conversions. When the appropriate set of conditions is met, and the DCONSSx bit is
set in the ADCIM register, an interrupt is sent to the interrupt controller.
NOTE:
For a 1 to 2 Msps rate, as the system clock frequency approaches the ADC clock frequency,
it is recommended that the application use the µDMA to store conversion data from the FIFO
to memory before processing rather than an interrupt-driven single data read. Using the
µDMA to store multiple samples before interrupting the processor amortizes interrupt
overhead across multiple transfers and prevents loss of sample data.
NOTE:
Only a single DCONSSn bit should be set at any given time. Setting more than one of these
bits results in the INRDC bit from the ADCRIS register being masked, and no interrupt is
generated on any of the sample sequencer interrupt lines. It is recommended that when
interrupts are used, they are enabled on alternating samples or at the end of the sample
sequence.
10.3.7.1.2 Triggers
The digital comparator trigger function is enabled by setting the CTE bit in the ADCDCCTLn register. This
bit enables the trigger function state machine to start monitoring the incoming ADC conversions. When the
appropriate set of conditions is met, the corresponding digital comparator trigger to the PWM module is
asserted.