Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Common API for Sleep Management / Example for UC3L-EK Documentation


This simple example shows how to use the Sleep manager.

Main files:

  • sleepmgr_example_uc3c_uc3l.c: Sleep manager example application
  • conf_example.h: configuration of I/O pins

Sleep manager API

The sleep manager API can be found here.

Device Info

All AVR UC3 C and UC3 L series devices can be used. The example has been tested on the UC3C-EK and UC3L-EK boards.

Description of the example

The device is put to sleep in sleep modes with increasing "depth", and is periodically woken up by the AST or asynchronously by an external interrupt for the modes which also disable the RTC. The device will remain in ACTIVE mode for approximately 3 seconds after wake- up, before it goes to sleep in the next mode.

The AST wakes the CPU every 3.5 seconds. If the device remains in sleep (LED turned off), the device has gone into a too deep sleep mode for the AST to operate (in the case of this example, the chosen source clock for the AST is the RCOSC and the RCOSC is stopped in the STATIC sleep mode). In that case, the user must wake the device up by applying a low-level on the external interrupt pin, e.g., by pushing a button connected to the pin (WAKE_BUTTON_EIC_PIN).

A pin (LED_ACTIVITY_STATUS_PIN) with, e.g., a LED connected is driven low when the device is active and driven high when the device is sleeping.

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.
Support and FAQ: https://www.microchip.com/support/