Microchip® Advanced Software Framework

Quickstart guide for MCP980X module

This is the quickstart guide for the MCP980X module, with step-by-step instructions on how to configure and use the drivers in a selection of use cases.

The use cases contain several code fragments. The code fragments in the steps for setup can be copied into a custom initialization function, while the steps for usage can be copied into, e.g., the main application function.

Basic use case

In this basic use case, the MCP980X module is configured to:

  • Disable ONE-SHOT mode
  • 12-bit temperature sensor accuracy
  • 2 fault queue cycles
  • Active-high alert polarity
  • Alert output in interrupt mode
  • Disable shutdown mode

Setup steps

Prerequisites

Example code

Add this MCP980X initialization code at the beginning of the main function:

Workflow

  1. Initialize MCP980X driver:
  2. Set MCP980X configuration:
  3. Set temperature limit:
  4. Set temperature hysteresis:

Usage steps

Example code

Add to, e.g., main loop in application C-file:

mcp980x_get_temperature(&temperature_int, &temperature_dec);

Workflow

  1. Enable One-Shot mode to perform a single temperature measurement:
  2. Retrieve ambient temperature: