Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Common API for Chip Reset Cause Access / Example for STK600-RC100X Documentation

Introduction

This example demonstrates how to use the reset cause interface.

Main Files

services/basic/cpu/reset_cause.h interface

The reset cause interface is described in the CPU reset cause section.

Device Info

All AVR devices can be used. This example has been tested with the following setup:

  • Xplain evaluation kit

Description of the example

The example will set LEDs on the board depending on the reset cause. The LEDs are wired to reset causes in the following order:

  • LED0: power-on-reset reset
  • LED1: on-chip debug system reset
  • LED2: JTAG reset
  • LED3: external reset
  • LED4: software reset
  • LED5: brown-out (on any power domains) detected reset
  • LED6: watchdog timeout reset
  • LED7: spike detection reset

Where boards have less than the number of LEDs given above, the list is shorted to the number of available LEDs.

On boards with at least one button, the first available button will be used to trigger a software reset when pressed.

Users will observe different LEDs active depending if the device was reset by toggling power, external reset input, reset triggered by programming and debug tools and finally triggered by pressing the on-board button.

Dependencies

This example depends on the gpio.h interface.

Compilation Info

This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.

Contact Information

For further information, visit Microchip.