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

nrf52832 Taking power on UART Lines

nrf52832 is connected to the main controller of the circuit on uart lines (RX and TX).
We have observed that even when we completely cut-off the power of nrf52832 then also it does not switch off. And it continues to be and running. And it draws power from the main controller through UART lines. Is this normal behavior? What can be done to avoid this?
Thnx for the help
Parents
  • Hi,

    Thanks for your response.

    You need to ensure that signal lines are either disconnected

    I am thinking to use a tri-state buffer IC to isolate the UART lines. The buffer IC is 74LVC126APW,118 (https://assets.nexperia.com/documents/data-sheet/74LVC126A.pdf). Will you suggest this?

    put into a suitable state.

    Can this be done in nrf52832 code? If yes, please share some references on this.

    Thanks for the help.

    Regards

    Kamran

  • Hi,

    The suitable state would be to set the pins that are connected to rx and tx as GPIO Input and disconnect the input buffer.  You can do this by writing to the appropriate PIN_CNF[N] register.

    regards

    Jared  

  • No - that won't work!

    is turning the nRF off - so it is the other device which needs to have its lines set to an appropriate state!

    Setting them as inputs might work;

    Setting them low might work;

    Insufficient information - and not a Nordic issue.

  • It seems I was too quick on this one, I thought i read sleep instead of turning it OFF. Good that we have a community that reviews our answers ;)

    Well, awneil is correct in pointing out that my previous suggestion won't work and that the focus should be on the other device. I would also like to add that a GPIO pin should never be connected to a voltage that is VDD + 0.3 V. 

  • Thanks,  and .

    Will implement as suggested and share the feedback here.

  • Hi,

    I want to configure RX and TX as GPIO and then to disconnect the input buffer, I am using the following functions:

    nrf_gpio_cfg_input(rx_pin, NRF_GPIO_PIN_NOPULL);   -->> this is to configure as input

    nrf_gpio_input_disconnect(rx_pin);                                   -->> this is used to disconnect the buffer

    nrf_gpio_cfg_watcher(rx_pin);                                          -->> this is used to enable input again on rx and tx lines. it is used when i want to enable the UART lines.

    But it does not work.

    Any suggestions?

    NOTE: earlier I mentioned that I am switching off nrf52832. But now I have dropped that method and the aim here is to disable UART lines after the communication is complete. And enable UART again when needed via an interrupt pin (this interrupt pin I working fine.)

    Thanks

  • But it does not work.

    Any suggestions?

    Yes I suggest you explain properly what "But it does not work" means. 

Reply Children
  • Yes sure. 

    Setup: one nrf52832 Development board.

    Content of main()

    int main(void)
    {

    log_init();   timer_init();   uart_init();
    db_discovery_init();  power_management_init();
    ble_stack_init();   gatt_init();  nus_c_init();  scan_init();
    gpio_init();

    nrf_gpio_input_disconnect(8); // disconnect RX
    nrf_gpio_input_disconnect(6); // disconnect TX

    app_timer_init();
    app_timer_create(&testtimer,APP_TIMER_MODE_SINGLE_SHOT,timerfunction);

    for (;;)
    {
    idle_state_handle();
    }
    }

    I have configured an interrupt on PIN 11 and a one-shot timer (of 5 sec ) is started once interrupt is received.

    Interrupt callback function:

    void in_pin_handler1(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    nrf_gpio_cfg_watcher(8);   // Enable RX
    nrf_gpio_cfg_watcher(6);  // Enable TX

    printf("BLE");
    scan_start();
    app_timer_start(testtimer, 5*32768, NULL);

    }

    Timer callback function:

    static void timerfunction(void * p_context)
    {
    UNUSED_PARAMETER(p_context);


    nrf_gpio_input_disconnect(8);   // Disconnect RX
    nrf_gpio_input_disconnect(6);   // Disconnect TX

    nrf_ble_scan_stop();
    printf("\r\n");
    }

    In the above setup: the UART lines should only active when the timer is running for 5 seconds after receiving interrupts. But the UART lines are always active. 

    To know the state of UART lines:

    In the function :

    uart_event_handle(app_uart_evt_t * p_event)

    I have included a printf statement.  (printf("uart_event_handle"))

    The above print statement should only get executed while the timer is running but no matter if the timer is running or not, I always get the print statement if i send some data to nrf.

    Hope it clarifies the issue

  • maybe just turn off external UART interface and set pin to low 

  • turn off external UART interface

    Do you mean NRF's UART? How to do this for NRF?