1.5.26 Supply Controller (SUPC)

The Supply Controller (SUPC) manages the voltage reference and power supply of the device.

The SUPC controls the voltage regulators for the core (VDDCORE) domain. It sets the voltage regulators according to the sleep modes, or the user configuration.

The SUPC embeds two Brown-Out Detectors. BODVDD monitors the voltage applied to the device (VDD) and BODCORE monitors the internal voltage to the core (VDDCORE). The BOD can monitor the supply voltage continuously (continuous mode) or periodically (sampling mode).

The SUPC generates also a selectable reference voltage and a voltage dependent on the temperature which can be used by analog modules like the ADC, SDADC or DAC.

Using The Library

The VDD Brown-Out Detector (BODVDD) is able to monitor the VDD supply and compares the voltage with the brown-out threshold level . When VDD crosses below the brown-out threshold level, the BODVDD can generate either an interrupt or a Reset. Brown out interrupt enables user to save critical data to prepare the system for a power-down.

Callback method

This example demonstrates how to get callback on brown-out detection to save critical work.

MY_APP_OBJ myAppObj;

void BOD_EventHandler(uintptr_t context)
{
    // The context was set to an application specific object.
    // It is now retrievable easily in the event handler.
    MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;

    // Brown-out interrupt occurred. Save critical data.
}

int main(void)
{
    /* Register callback function */
    SUPC_BODVDDCallbackRegister(BOD_EventHandler, (uintptr_t)&myAppObj);

    while(true)
    {

    }
}

Library Interface

Supply Controller peripheral library provides the following interfaces:

Functions

Name Description
SUPC_Initialize Initializes the SUPC peripheral
SUPC_SelectVoltageRegulator Selects the main voltage regulator
SUPC_SetOutputPin Sets a specific output pin (OUTx) to logic HIGH
SUPC_ClearOutputPin Clears a specific output pin (OUTx) to logic LOW
SUPC_BODVDDCallbackRegister Registers the function to be called when a Brown Out Event has occurred

Data types and constants

Name Type Description
SUPC_OUTPIN Enum Identifies the output pins of SUPC peripheral
SUPC_VREGSEL Enum Identifies the Main Voltage Regulators
SUPC_BODVDD_CALLBACK Typedef Defines the data type and function signature for the SUPC peripheral callback function