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

How to implement soft uart in Pca10028?

Hello,

I am using pca10028 and sdk 12. I want to use 2 uart for my application but as per datasheet nrf51 has only one hardware uart. Can I implement soft uart on pca10028? I want to use both the uart at the same time so multiplexing will not help me.

Sdk_config.h New Text Document (3).txt

Main.c New Text Document (3).txt

Thanks, Shailav

  • Hi Shailav,

    I am afraid that we do not have any examples showing how create a software-based("bit-banged") UART for the nRF51 Series. Have you considered using the nRF52840 that has two UARTs?

    Best regards

    Bjørn

  • A bit banged UART is not that hard to implement, especially for low baud rates - for a simple example see:

    electronut.in/.../

  • Hi Bjørn, As of now I am not using nrf52840. I have nrf51 and nrf52832(pca10040). My application is as follows: I am scanning the nearby ble devices using code ble_app_uart_c(central role). Now uart pins 11 and 9 are used for tx and rx so that I can see the output on my terminal. Can I see the output in terminal without wasting this pins? I want to send some at commands to esp8266 using pins 11 and 9 but as these pins are already in use I am not able to do this. Any suggestions? Thanks

  • Yes, you can use Segger's RTT instead of the UART by setting NRF_LOG_BACKEND_SERIAL_USES_RTT to 1 and NRF_LOG_BACKEND_SERIAL_USES_UART to 0 in skd_config.h. See this Infocenter page for more information on the logger module.

  • Hi Bjørn, I was able to set up RTT viewer. When I am writing this SEGGER_RTT_WriteString(0, "Hello World!\n"); I am able to see output in RTT viewer but when I am using the printf function for example SEGGER_RTT_printf(0, "variable value: %d\n", err_code); I am getting error as ._build\nrf51422_xxac.axf: Error: L6218E: Undefined symbol SEGGER_RTT_printf (referred from main.o). What can be the problem? Thanks, Shailav

Related