1.34.21 Supply Controller (SUPC)

The Supply Controller controls the Embedded Voltage Regulators used by the Core Power Supply and Backup Low Power Mode.

In Backup Low Power Mode the current consumption is reduced to a few microamps for Backup power retention. Exit from this mode can be achieved via multiple wake-up sources.

The Supply Controller also generates the Slow Clock (SCLK) by selecting either the 22-42kHz Low Power RC oscillator or the 32kHz Low Power Crystal oscillator.

The purpose of Backup Low Power Mode is to achieve the lowest power consumption possible in a system that wakes up periodically in order to perform tasks that do not require a fast startup time.

The supply controller, zero-power power-on reset, RTT, RTC, backup registers, and 32kHz oscillator (RC or crystal oscillator selected by software) are all running whilst the regulator and core supply are off.

Following wakeup sources can wakeup the device from backup mode.

  • 14 Wakeup Inputs with Programmable Debouncing

  • Real-Time Clock Alarm

  • Real-Time Timer Alarm

  • Supply Monitor Detection on VDDIO, with Programmable Scan Period and Voltage Threshold

Using The Library

SUPC Peripheral library provides API's and they can be used to perform below functionalities.

  • To put the device either in Sleep, Backup or Wait mode.

  • To read and write the General Purpose Backup Register (GPBR).

  • Generate supply monitor callback to save critical data to prepare the system for a power down. Supply monitor can generate interrupt or Reset the device when supply voltage crosses below the specified threshold level.

The examples shows the code to enter sleep, backup and wait mode.

while(1)
{
    switch(cmd)
    {
        case SLEEP_MODE:
        {
            SUPC_SleepModeEnter();
            break;
        }
        case WAIT_MODE:
        {
            SUPC_WaitModeEnter(PMC_FSMR_FLPM_FLASH_DEEP_POWERDOWN, WAITMODE_WKUP_WKUP7);
            break;
        }
        case BACKUP_MODE:
        {
            SUPC_BackupModeEnter();
            break;
        }
    }
}

Library Interface

Supply Controller peripheral library provides the following interfaces:

Functions

Name Description
SUPC_Initialize Initializes SUPC x module of the device
SUPC_SleepModeEnter Puts the device into Sleep mode
SUPC_WaitModeEnter Puts the device into Wait mode
SUPC_BackupModeEnter Puts the device into Backup mode
SUPC_GPBRRead Reads the data from General Purpose Backup Register(GPBR)
SUPC_GPBRWrite Writes data to the General Purpose Backup Register(GPBR)
SUPC_CallbackRegister Allows application to register callback with PLIB

Data types and constants

Name Type Description
WAITMODE_WKUP_SOURCE Enum Identifies the wakeup input source
WAITMODE_FLASH_STATE Enum Identifies Flash Low-power mode
SUPC_CALLBACK Typedef Pointer to a SUPC callback function