UART and USART Low-Power Instance#

The Ultra-Low-Power (ULP) Universal Asynchronous Receiver-Transmitter (UART) peripheral is optimized for energy-efficient applications that require minimal power consumption. Managed by the Power Manager, this peripheral is part of the ULP subsystem and remains accessible in the Power State 2 (PS2) low-power mode through platform-level power management.

The Power Manager coordinates power-state transitions, peripheral enablement, random access memory (RAM) retention, and wakeup sources. This coordination allows the ULP UART to operate during PS2 low power state, extending battery life and enabling always-on communication.

Pin Selection: ULP GPIO vs. HP GPIO#

Pin selection affects communication reliability and power consumption. This section describes when to use ULP general-purpose input/output (GPIO) pins and when High-Performance (HP) GPIO pins may be appropriate.

ULP GPIO#

  • Always use ULP GPIO pins for UART in low-power states.

  • Only ULP GPIO pins associated with the ULP UART are retained and functional in PS2.

HP GPIO#

  • If you use HP GPIO pins, reconfigure them to ULP-compatible settings before entering PS2 and restore them after wakeup.

  • HP GPIO pins are not available in PS2, PS1 and deep sleep. Improper selection can cause communication loss or increased power consumption.

Achieving Low-Power Operation#

To ensure reliable operation in PS2, configure the ULP UART and related components for low-power performance. This section provides the required steps.

  1. Configure the Power Manager in Simplicity Studio to enable PS2.

  2. Verify that the ULP UART component is enabled.

  3. Use the sl_si91x_power_manager_add_ps_requirement API to switch to PS2.

  4. Disable unnecessary peripherals and configure RAM retention as required.

  5. Use ULP memory for direct memory access (DMA) buffers if needed.

  6. Configure wakeup sources such as GPIO, timers, or wireless modules by using Power Manager APIs.

// Deinitialize UART before entering low power
sl_si91x_usart_deinit(uart_handle); // Disables peripheral
// Add PS2 requirement to enter low power mode
sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS2);
// ... MCU PS2 enters low-power state ...

Reconfiguring Peripherals Across Sleep Wakeups#

After waking from PS2, you must reinitialize and reconfigure the ULP UART and GPIO peripherals to restore communication. This section explains the sequence to follow.

  1. Reinitialize the UART peripheral by using sl_si91x_usart_init.

  2. Reinitialize ULP GPIOs for UART and wakeup sources. Use DEBUGINIT() for debug output if needed.

  3. Restore any settings lost during sleep, such as FIFO thresholds or callback or event registrations.

  4. Resume UART transfers or sensor communication.

Example:

sl_si91x_usart_init(UART_1, &uart_handle); // Reinitialize UART
DEBUGINIT(); // Reinitialize GPIOs for debug output
sl_si91x_usart_set_configuration(uart_handle, &uart_config);
// Reconfigure configuration and resume operation

This sequence ensures reliable operation and communication with peripherals after each sleep and wakeup cycle.

Practical Example Flow#

This section shows a complete flow for initializing UART in high-power mode, transitioning to low-power operation, and resuming communication after wakeup.

Start in PS4 (High Power)#

Initialize UART and perform normal communication.

sl_si91x_usart_init(UART_1, &uart_config);
DEBUGINIT(); // Reinitialize GPIOs for debug output
sl_si91x_usart_set_configuration(uart_handle, &uart_config);
// ... Send/receive data as needed

Switch to PS2 (Low Power)#

  1. Power off unused peripherals.

  2. Configure RAM retention.

  3. Reconfigure UART for ULP mode.

  4. Use ULP memory for DMA if required.

sl_si91x_usart_deinit(uart_handle); // Disables peripheral and clears FIFOs
sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS2); // Enter PS2
// ... MCU goes to PS2 state ...

Reconfiguring in PS2#

  1. Reinitialize UART and GPIO.

  2. Restore configuration settings.

  3. Continue normal operation.

sl_si91x_usart_init(UART_1, &uart_handle); // Reinitialize UART
DEBUGINIT(); // Reinitialize GPIOs for debug output
sl_si91x_usart_set_configuration(uart_handle, &uart_config);
// Restore configuration and resume operation

Additional Resources#

For detailed examples using ULP UART, see: