This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Current Consumption when using timer and scheduler alongwith nrf_pwr_mgmt_run().

Hi Everyone,

I am using the following peripherals in my project

2 UARTE.

2 ADC 

1 TWI

BLE

GPIOTE interrupt for 2 buttons

TWI and ADC and BLE and GPIOTE are not consuming more current when there are no events (when its in sleep mode, current is around 240uA)

However , when i initialise the 2 UART and also uninit both of them , the current doesn't come below 1.1mA , Is it Normal?

If not , how can i set up the UART part to use 2 UARTEs without consuming much current in the sleep mode , when there are no events occuring.

I have a custom PCB using nrf52840 , SDK 15.0 And Segger Embedded Studio IDE.

  • I could get the low current by disabling the UARTE0 , but not for UARTE1. 

    Don't you think , the address to disable UARTE0 and UARTE1 should be different?

  • The addresses for disabling UARTE0 and UARTE1 are different (0x40002FFC and 0x40028FFC). These registers are undocumented as they should not normally be used, but are needed as a workaround in this case.

    Please refer to the code snippet in my previous answer for a full example that demonstrates how you can use both in low power mode. To extract just the main point you should use this code (I include the call to  nrf_serial_uninit() for completeness):

        // Disable UARTs to reduce current consumption
        nrf_serial_uninit(&serial0_uarte);
        nrf_serial_uninit(&serial1_uarte);
    
        // Workaround current consumption issue by power cycling the UART peripherals
        *(volatile uint32_t *)0x40002FFC = 0;   // Power down UARTE0
        *(volatile uint32_t *)0x40002FFC;       //
        *(volatile uint32_t *)0x40002FFC = 1;   // Power on UARTE0 so it is ready for next time
    
        *(volatile uint32_t *)0x40028FFC = 0;   // Power down UARTE1
        *(volatile uint32_t *)0x40028FFC;       //
        *(volatile uint32_t *)0x40028FFC = 1;   // Power on UARTE1 so it is ready for next time

Related