Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AFEC Temperature Sensor Example

Purpose

The example demonstrates how to use the temperature sensor feature inside the microcontroller.

Requirements

This example can be used on SAM4E-EK boards , SAMV71-Xplained-Ultra , SAME70-Xplained.

Description

The example is aimed to demonstrate the temperature sensor feature inside the device. To use this feature, the temperature sensor should be automatically turned on by RTC event. The channel 15 is connected to the sensor by default. If set RTCT = 1, TRGEN is disabled and all channels are disabled (AFE_CHSR = 0), then only channel 15 is converted at a rate of 1 conversion per second.

The temperature sensor provides an output voltage (VT) that is proportional to absolute temperature (PTAT). The relationship between measured voltage and actual temperature could be found in Electrical Characteristics part of the datasheet.

Usage

  1. Build the program and download it into the evaluation board.
  2. On the computer, open and configure a terminal application (e.g., HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  3. In the terminal window, the following text should appear (values depend on the board and the chip used):
    -- AFEC Temperature Sensor xxx --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
  4. The application will output current Celsius temperature on the terminal.