Backup Self-Refresh (BSR) Mode

Last modified by Microchip on 2026/12/03 14:22

Introduction

Backup with SDRAM in Self-Refresh (BSR) mode extends Backup mode by keeping the application context in external Double Data Rate (DDR) memory while the memory is in self-refresh. This allows the application to resume more quickly after wake-up.

The conditions to enter Backup Self-Refresh mode are:

  • Event Sampling Clock  
    • MD_SLCK
  • Mode Entry 
    • Context saved in SDRAM
    • SDRAM in Self-Refresh
    • Use SHDWC to shut down all power supplies except Double Data Rate Input/Output Supply Voltage (VDDIODDR)
    • and Backup Battery Supply (VBAT)
  • Main System Bus Clock (MCK1) at Wake-up  
    • MAINCK (defaults to Main RC osc.)

Enter BSR Mode

In this mode, VBAT and VDDIODDR power inputs must be maintained, as well as the DDR component power inputs. It is good practice to use a combination of Low-Power Mode (LPM) and Shutdown (SHDN) outputs from the Shutdown Controller (SHDWC) to signal the power management circuit to enter this special powering mode. 

Enter Self-Refresh mode.

​​​​​I/O power down as described in the "Entering Self-Refresh Mode with I/O Power-down" procedure (see the "SDRAM Self-Refresh Mode" section in the SAMA7D65 data sheet).

Information

A combination of the LPM and SHDN signals, both outputs of the Shutdown Controller (SHDWC), requests a special powering mode to the external power supply where VDDIODDR is maintained. These outputs are supplied by VBAT present in BSR mode.


Enter Backup Self-Refresh mode:

Write a special code (0x12345678, for example) in a backup register to identify the BSR state.

Disable System Controller (SYSC) write protection.

Clear the SHDWC Control register.

Configure the wake-up source.

Send Shutdown and LPM Enable commands to the SHDWC Control register.


Similar to the power-down sequence, the reset (NRST) signal must be asserted prior to turning the SAMA7D6 power supplies off.

The following figure shows the recommended power-down sequence to place the device in BSR mode (Backup Mode with SDRAM in Self-Refresh mode to save the context).

BSR Mode

Exit BSR Mode

The device exits BSR mode when an active wake-up event is triggered by the SHDWC. Upon this wake-up event, the SHDWC automatically toggles its SHDN output back to VBAT and this signal typically helps to restart all the power supply channels at board level. The LPM pin is not automatically reset by the SHDWC. It must be reset by software in the early steps of the wake-up process. The system power consumption in BSR mode is mainly that of the DDR; therefore, the type of DDR selected is of prime importance. Similarly, the selection of the regulator(s) that maintain(s) DDR supplies in BSR mode should optimize efficiency at low current.

The wake-up events to exit Backup Self Refresh mode are:

  1.  PIOBU[3:0]
  2.  WKUP0 pin
  3.  SECUMOD events
  4.  RTT alarm
  5.  RTC alarm

Exit BSR Mode

Back to Top


Bare-Metal Implementation Using the MPLAB® Development Ecosystem

To enable Wake-Up (WKUP) interrupt using MPLAB® Code Configurator (MCC), launch MCC and select Interrupt Configuration from the Plugins drop-down. Enable SHDWC. Select EDGE for Configuration and then click the Generate button.

Interrupt Configuration


The code snippet to enter backup Self Refresh mode is shown in the following images:

Code Snippet

To test it while entering Backup mode, write to General-Purpose Backup Register (GPBR), Static Random-Access Memory (SRAM) Backup area, and Double Data Rate RAM (DDRAM), then read and verify those memories upon exit.

A sample application file is available here for reference.

Back to Top

Test the Application

Warning

A 3V CR1220 battery should  be placed in the BT1 battery holder on the SAMA7D65 Curiosity Development Board to permanently maintain the VDDBU voltage. This function allows the user to shut down the MPU and the system, thus entering a Backup Self Refresh mode, and still keep the custom configuration that was previously set in the MPU backup area

To test the application:

Copy and paste boot.bin and harmony.bin to the SD card and insert it into the SD card slot at J10. Press the Reset button to run the application.

Press User switch to interrupt the normal Analog-to-Digital Converter (ADC) application and enter 2 in the serial console window to enter Backup Self Refresh mode. 

To exit backup Self Refresh mode press the WKPU button on the board.

The serial console output is as shown in the accompanying image:

Output 1

Note that the system reboots and it executes the application again. 


To test the backup Self-Refresh mode:

Press User switch to interrupt the normal ADC application and enter 7 in the serial console window to test Backup Self Refresh mode.

After the device exits Backup Self-Refresh mode, the values previously written to the GPBR, backup SRAM, and DDRAM are still retained.

The serial console output is as shown in the accompanying image:

Output 2

Back to Top

Current Measurement

As per the data sheet, Backup mode current consumption is as follows:

Power Measurement

Back to Top

Learn More

Back to Top