Analog-to-Digital Converter (ADC) Setup

For the application to be able to initiate ADC conversions from an event signal instead of using the core, the Start Event Input - feature of the ADC - must be enabled. Then, to store and handle the conversion result as soon as it is available, the result ready interrupt may be enabled as well.

One of the internal analog sources available to the ADC is the voltage from the on-board temperature sensor. To configure the ADC to sample the temperature sensor, the ADC reference may be set to the internal reference, and the sensor may be selected as the ADC input signal. Then, the ADC voltage reference may be set to 1.1V and enabled in the Voltage Reference (VREF) module.

By setting the ADC up as described, a 10-bit converted voltage value will be available in the ADC Result register when the result ready interrupt is requested. To convert the result to a temperature value, it must be corrected by an offset and a gain factor included in the signature row of the device. For simplicity, this correction is not included in the application example.