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

Possible to bitbang a 9600baud UART on nRF51822?

Is it possible to bit bang a 9600 baud UART on the nRF51822 while the BLE softdevice is running?

The reciprocal of 9600 baud is around 100 µs, so the interrupt handler will need to run about that often for the UART to work reliably. However, the S110 SDS specifies that the processor could be taken up by the highest-priority soft device interrupt for up to 400-500 µs.

It seems to me that would prevent the bit-bang timer interrupt from running, and would cause bits to be lost. Is this correct?

I need to communicate with two different devices (so 2 UARTs) using a protocol with 2 stop bits, so I cannot use the chip's hardware UART

Parents
  • I was answering thinking that the question is to achieve the max speed that is 9600 baud rate. The method you mentioned will work with a flow control enabled bit banging (for RX to work), but the bit rate achieved will be much less. There is a post for safe attainable baud rate while in connections to be 9600, and this uses hardware UART devzone.nordicsemi.com/.../ I agree with you RK, its doable, but could be tricky. @Brendan Shanks : Could I request you to post your progress in Github github.com/NordicSemiconductor If you succeed, this could prove useful to many.

  • Now I'm advertising @40ms. I've not yet tested bit banging in connection. Now I'm trying to solve some issues. @9600bps, timeslot duration is 1240µs, I've just discovered duration between two bytes was ~2ms due to timeslot extension failure. Now I'm checking all runs fine and after I will test with with small connection intervals.

Reply
  • Now I'm advertising @40ms. I've not yet tested bit banging in connection. Now I'm trying to solve some issues. @9600bps, timeslot duration is 1240µs, I've just discovered duration between two bytes was ~2ms due to timeslot extension failure. Now I'm checking all runs fine and after I will test with with small connection intervals.

Children
No Data
Related