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

Second UART

Hi,

I'd like to have a second UART available, as the nRF51822 only has one and I'm wondering if there exists a UART software emulation example implemented already for this CPU. I couldn't find anything related in the SDK...

Thanks! florin

Parents
  • It is long ago you asked this question. This week I had the same problem. Transmitting data was not a problem, because it is rather easy to multiplex the TX output of one UART. For RX multiplexing is not really a solution. Therefore I wrote a software RX part of a UART. I use GPIOTE, a TIMER and PPI to have as much handled by interrupts. I build it to run at 9600 baud with the softdevice enabled. Alas when the radio is active, this baudrate is a little to fast. Some characters are lost. Still I have attached the source. srx_drv.c srx_drv.h

    regards, Erik

Reply
  • It is long ago you asked this question. This week I had the same problem. Transmitting data was not a problem, because it is rather easy to multiplex the TX output of one UART. For RX multiplexing is not really a solution. Therefore I wrote a software RX part of a UART. I use GPIOTE, a TIMER and PPI to have as much handled by interrupts. I build it to run at 9600 baud with the softdevice enabled. Alas when the radio is active, this baudrate is a little to fast. Some characters are lost. Still I have attached the source. srx_drv.c srx_drv.h

    regards, Erik

Children
Related