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

nRF9160 RX interrupt not triggering after UART disabled and enabled again

Hi,

I am using ncs 1.0.0 in nRF9160. 

I have enabled UART 2 interrupt during initialization of the uart as below and it works fine. 

    uart = device_get_binding("UART_2");

    uart_irq_callback_set(uart, uart_cb);
    uart_irq_rx_enable(uart);

To reduce the power consumption i need to disable the UART2 when it is not needed. 

I have disabled the UART2 as below 

nrf_uarte_disable(NRF_UARTE2);

But when i enable the UART2 I am not getting UART 2 RX interrupt. 

I have enabled the UART 2 as below 

nrf_uarte_enable(NRF_UARTE2);

Can you help me in finding why UART RX interrupt doesn't work after i disable and enable the UART 2. 

Regards,

Smitesh Mali

Parents Reply
  • Hi,

    I disabled the UART as below 

    NRF_UARTE2_NS->TASKS_STOPRX  = 1;
    NRF_UARTE2_NS->TASKS_STOPTX = 1;
    while(NRF_UARTE2_NS->EVENTS_RXTO==0);

    I enabled it like below 

    NRF_UARTE2_NS->TASKS_STARTRX = 1;
    NRF_UARTE2_NS->TASKS_STARTTX = 1;
    
    

    But i observed that current consumption on "power profiler" is around 500 uA. 

    When i was turning off the UART 2 using "nrf_uarte_disable(NRF_UARTE2)" i was getting 7 uA current.

    am i doing turning off UART 2 correctly ?

    Regards,

    Smitesh Mali

Children
Related