Jump to main content

##

# 3.31.20 Shutdown Controller (SHDWC)

The Shutdown Controller asserts the SHUTDOWN output pin and performs wakeup detection on debounced input lines.

It has the following Embedded Characteristics:

- Shutdown Logic

  - Software Assertion of the Shutdown Output Pin (SHDN)

  - Programmable deassertion from the PIOBU, WKUP Input Pins

- Wakeup Logic

  - Programmable Assertion from the PIOBU, WKUP Input Pins, and Internal Wakeup Event from RTC, RXLP, ACC, Security Module

## Using The Library

Shutdown peripheral library can be used to:

- Configure the wakeup events for the MPU

- Software assert the SHDN signal to indicate that the MPU needs to be shutdown. A typical application connects the pin SHDN to the shutdown input of the DC/DC Converter providing the main power supplies of the system, and especially VDDCORE and/or VDDIO.

- Get the event that caused the MPU to wake up

The following program demonstrates assertion of the SHDN signal on pressing of a switch connected to the PIO.The program normally toggles an LED, and upon pressing the switch the SHDN signal is asserted. This signal,if connected to the external PMIC, would then be used to manage the power to the MPU.

    void switchHandler( PIO_PIN pin, uintptr_t context)
    {
        SHDWC_Shutdown();
    }

    int main ( void )
    {
        /* Initialize all modules */
        SYS_Initialize ( NULL );
        PIO_PinInterruptCallbackRegister(SWITCH_PIN, switchHandler, 0);
        PIO_PinInterruptEnable(SWITCH_PIN);

        while ( true )
        {
            PIT_DelayMs(500);
            LED_Toggle();
            /* Maintain state machines of all polled MPLAB Harmony modules. */
            SYS_Tasks ( );
        }

        /* Execution should not come here during normal operation */
        return ( EXIT_FAILURE );
    }

## Library Interface

Shutdown Controller peripheral library provides the following interfaces:

Functions

Name | Description
--- | ---
SHDWC_Initialize | Initialize shutdown controller
SHDWC_Shutdown | Assert the shutdown signal
SHDWC_GetWakeup | Read and clear the status register