Microchip® Advanced Software Framework

Quick Start Guide for the SAM AT30TSE75X Temperature Sensor Driver

In this use case we will interface the temperature sensor, set a resolution and read the temperature.

Prerequisites

The temperature sensor must be connected to the device.

Setup

Initialization Code

Add a global variable to store the temperature:

double temp_res;

Copy-paste the following setup code to your application main function:

/* Init system. */
/* Configure device and enable. */

Workflow

  1. Initialize system
  2. Initialize I2C interface

Implementation

Code

Add after initialization in main.

/* Read thigh and tlow */
volatile uint16_t thigh = 0;
volatile uint16_t tlow = 0;
/* Set 12-bit resolution mode. */
while (1) {
}

Workflow

  1. Read THIGH register from temperature sensor:
  2. Read TLOW register from temperature sensor:
  3. Set temperature sensor resolution to 12-bit:
  4. Continuously read the temperature:
    while (1) {
    }