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

nrf9160 uart Pull-Up and power consumption

hi all,

i'm trying to disable uart for lower power consumption, i've disables it with:

Fullscreen
1
2
NRF_UARTE1->TASKS_STOPTX = 1;
NRF_UARTE1->TASKS_STOPRX = 1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


but when i measure the voltage on the rx pin i see 1.8V  (this seems to consume current on the device on the other side of the uart interface - which is turned off )
i assume its in pulled up state, so i'm trying to change it's state to no-pull:
Fullscreen
1
2
3
4
5
nrf_uarte_txrx_pins_disconnect(NRF_UARTE0);
gpio_pin_configure(uart_wifi, 18, GPIO_PUD_PULL_DOWN);
gpio_pin_configure(uart_wifi, 19, GPIO_PUD_PULL_DOWN);
gpio_pin_write(uart_wifi, 18,0);
gpio_pin_write(uart_wifi, 19,0);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 but it doesnt seem to have any effect.

how can i set this pin to 0, and back to 1 when I need it , on runtime?

Thanks

Moshe

Parents
  • Hi Moshe, 

    Is the external IC power gated? It should drive the RX line to 'high' when it's inactive and powered. So that may explain why you see the current draw when you set the output to 0. 

    Also, from your code snippets, it appears that you are stopping UART instance 1 while nrf_uarte_txrx_pins_disconnect() call takes instance 0 as an argument. Not sure if this is intended or not.

    Best regards,

    Vidar

  • Hi Vidar,

    Thanks for your answer, 

    1. I called `nrf_uarte_txrx_pins_disconnect()` on both UARTs (didnt copy it into the snippet).

    2. I test this while the external IC is powered off  (it is gated ) . 

    3. Just to be clear, even when I  disable UART from the SW, I still measure 1.8v on the TX pin . I guess it is still pulled up . 

    Thanks and BR

  • Hi,

    Just to make sure, did you disable the UARTE before you re-configured the pins? UART pins can't be re-configured while the interface is enabled. 

Reply Children
  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    1514 void disable_uart(){
    1515 NRF_UARTE0->TASKS_STOPTX = 1;
    1516 NRF_UARTE0->TASKS_STOPRX = 1;
    1517 NRF_UARTE0->ENABLE= UARTE_ENABLE_ENABLE_Disabled;
    1518
    1519 NRF_UARTE1->TASKS_STOPTX = 1;
    1520 NRF_UARTE1->TASKS_STOPRX = 1;
    1521 NRF_UARTE1->ENABLE= UARTE_ENABLE_ENABLE_Disabled;
    1522
    1523 NRF_UARTE0_NS->TASKS_STOPTX = 1;
    1524 NRF_UARTE0_NS->TASKS_STOPRX = 1;
    1525 NRF_UARTE0_NS->ENABLE= UARTE_ENABLE_ENABLE_Disabled;
    1526
    1527 NRF_UARTE1_NS->TASKS_STOPTX = 1;
    1528 NRF_UARTE1_NS->TASKS_STOPRX = 1;
    1529 NRF_UARTE1_NS->ENABLE= UARTE_ENABLE_ENABLE_Disabled;
    1530
    1531 nrf_uarte_txrx_pins_disconnect(NRF_UARTE0);
    1532 nrf_uarte_txrx_pins_disconnect(NRF_UARTE1);
    1533 nrf_uarte_txrx_pins_disconnect(NRF_UARTE0_NS);
    1534 nrf_uarte_txrx_pins_disconnect(NRF_UARTE1_NS);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    this is the code we have used . 

    it seems that it is in the right order.

  • Yes, it seems correct to me. So I don't see how the RX line could be 1.8v when the ext. device is powered off. But you mentioned that the external device seems to draw current. Did you determine that based on the total current consumption? 

  • Hi Vidar , 

    >> Did you determine that based on the total current consumption? 

    yes, I did.

    How can I further debug this issue? 

  • Could you let me know the current consumption you see is? Here are some things you can try:

    - Verify GPIO pin configuration RX and TX by reading out the configuration registers with your debugger. Also, the pin that controls the power to the external device if you use an output pin for it.

    - If possible, get a baseline measurement by measuring the current consumption before enabling UARTE and power to external circuitries.  

    - Check the enable registers for all UART instances. 

  • Hi,

    1. current consumption is around 1ma.

    2. Verified the GPIO's from the register and they look ok, the pins that contols the external device I measured the voltage and it looks corrct.

    3. checked the ENABLE , they look ok .