3 ADCC Temperature Measurement

This example shows how to read the internal temperature sensor of the microcontroller. To achieve that, the ADCC should be enabled and configured to use its dedicated clock (FRC) with results right-justified.

The microcontroller is equipped with a temperature circuit designed to measure the operating temperature of the silicon die (internal temperature). It is integrated into the Fixed Voltage Reference (FVR) module and provides a voltage proportional with the die temperature.

The temperature sense circuit is enabled by setting the Temperature Indicator Enable (TSEN) bit in the Fixed Voltage Reference Control (FVRCON) register. It provides two selectable output ranges: the high range provides more resolution over temperature range and a higher operating range (>3.6V), while the lower range is provided for low-voltage operation. The range is selected by the Temperature Indicator Range Selection (TSRNG) bit in the FVRCON register

First, the sample capacitor will be discharged and then a conversion will be started on the temperature channel.

Two macros are provided for transforming the received ADCC value into a Celsius or Fahrenheit value.

To achieve the functionality described by the use case, the following actions will be performed:

  • System clock initialization
  • Port initialization
  • ADCC initialization
  • Discharge sample capacitor
  • Starting the conversion