Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Sleepwalking example using the ADCIFB module on AVR UC3 L devices

Introduction

The Example projects demonstrates:

  • Sleepwalking Feature in AT32UC3L devices :
    SleepWalking feature allows to reduce the power consumption of the peripherals in sleep modes. It allows the UC3L Event System to handle asynchronous events in various sleep modes by requesting a module local clock for the duration of the Event processing. When the event processing ends, the clock request is dis-asserted and the module goes back to sleep.
  • Sleepwalking with ADCIFB Module in AT32UC3L devices :
    The given example demonstrates the use of ADCIFB using SleepWalking feature. The ADCIFB interface once configured remains in the sleep mode. The AST (Asynchronous Timer) is configured to run at 32KHz oscillator and periodically generates an event which will be used by ADCIFB. Upon receiving the event, ADCIFB module clock will be enabled and analog value on the selected channels will be sampled. The sampled output value will then be compared against a preset value stored in ADCIFB CVR register and if it is less than preset, an interrupt will be generated by ADCIFB. This will wake up the CPU as well as rest of the system. The ISR will execute LED chaser sequence and system will back to sleep. In case the sampled value is less than preset ADCIFB will go back to sleep.

Main Files

References

  • Refer Application Note AVR32849: Sleepwalking with AT32UC3L
  • Refer Application Note AVR4029: ASF Getting Started Guide
  • Refer Application Note AVR 4030: ASF Reference Manual

Compiler Support

The example application supports:

  • IAR EWAVR32
  • GNU GCC for AVR32

Device Support

  • AT32UC3L0 Series

Test Information

This example has been tested with the following :

  • AVR Studio 5.0
  • IAR32 Embedded Workbench
  • STK600 development board, UC3-L0-XPLAINED and UC3L-EK evaluation kits
  • 1.8V and 3.3V Supply mode

Setup Information

  • CPU Clock Source : DFLL(96MHz) with internal RCSYS as its source
  • AST Clock Source : 32KHz external oscillator
  • CPU Speed : 12MHz
  • PBA Speed : 6MHz
  • PBB Speed : 6MHz
  • AST Trigger Period: Every 250ms
  • UC3L-EK: ADC Channel 4 connected to Battery Voltage Sensor.
    Note1: There is a resistor bridge between the battery and the ADC pad on the AT32UC3L-EK. The data converted is half of the battery voltage.
    Note2: if the battery is not in place, the conversion is out of spec because the ADC input is then higher than ADVREF.
    --------------------------------------------------------—
    ADCIFB Input Pin name - UC3L-EK board Port-pin name
    --------------------------------------------------------—
    Battery Voltage Sensor
    ADCIFB AD[4] - PA18 Pin 1 on J15 Header
    --------------------------------------------------------—
  • UC3-L0-XPLAINED: ADC Channel 4 connected to NTC Temperature Sensor
    --------------------------------------------------------—
    ADCIFB Input Pin name - UC3-L0-XPLAINED board Port-pin name
    --------------------------------------------------------—
    NTC Temperature Sensor
    ADCIFB AD[4] - PA18 Pin 4 on J2 Header
    --------------------------------------------------------—

Contact Information

For further information, visit : Atmel AVR32 .
Technical support & faq, visit : Support and FAQ .

Author
Microchip Technology Inc : http://www.microchip.com