This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF51 Stop/Start UART function to save energy

Hi. I'm using PCA10028, SDK10.0.0, S130.

Q1. I want UART to start or stop whenever I want. It's to save current consumption. There is "uart_init()" for reference, but I don't know how to stop it.

Q2. As I've tested, uart_init() function time is almost 340mSec right after system power on. I want faster UART start time after UART stop.

I need your help.

  • To save energy you can use the hardware flow control to turn off uart when it is not needed. Unfortunately this is not an option currently in our SDK and not easy to do. You could init/uinit uart using nrf_drv_uart_init()/uninit(), but I am not sure if this will work out of the box.

    This example on github use hardware flow control or other gpio pins to turn off uart when it is not needed. It use SDK 6.1 and a port is not easy. I will make an internal request for low power uart in our SDK as this is needed.

    About uart_init() function taking 340ms, are you sure about that? Measuring the time on APP_UART_FIFO_INIT(..) i get about 53us.

  • Hi,

    I am using APP_UART_FIFO_INIT function (SDK 11) for initilizing the UART. For un-initializing it I tried both app_uart_close and nrf_drv_uart_uninit but still after calling the initialization function the err_code is so that it restarts the device. Currently I am using NVIC_SystemReset to reset the device after disconnecting from UART and to be able to initialize it again. Is there any better solution?

Related