4 Using USART to Wake Up ATmega328PB from Sleep Mode

The USART start frame detector can wake up the MCU from all six sleep modes when it detects a start bit.

When a high-to-low transition is detected on RxDn, the internal 8MHz oscillator is powered up and the USART clock is enabled. After start-up the rest of the data frame can be received, provided that the baud rate is slow enough in relation to the internal 8MHz oscillator start-up time. Start-up time of the internal 8MHz oscillator varies with supply voltage and temperature.

The USART start frame detection works both in asynchronous and synchronous modes. It is enabled by writing the Start Frame Detection Enable bit (SFDE). If the USART Start Interrupt Enable (RXSIE) bit is set, the USART Receive Start Interrupt is generated immediately when start is detected.

When using the feature without start interrupt, the start detection logic activates the internal 8MHz oscillator and the USART clock while the frame is being received, only. Other clocks remain stopped until the Receive Complete Interrupt wakes up the MCU.

The table below describes how to use USART to wake up ATmega328PB from sleep mode.

Table 4-1. USART Start Frame Detection Modes
SFDERXSIERXCIEDescription
0XXStart frame detector disabled
100Reserved
101Start frame detector enabled. RXC flag wakes up the MCU from all sleep modes.
110Start frame detector enabled. RXS flag wakes up the MCU from all sleep modes.
111Start frame detector enabled. Both RXC and RXS wake up the MCU from all sleep modes.