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

nRF51822 Uart - Lost bytes even with Hardware Flowcontrol

This post is not a question but a result of my analysis and so a answer to the above problem.

I tried both the Simple Uart Example from the Sdk 6.0.0 (Uart without interrupt) and also Ole Morten's interrupt driven app_uart_example here in devzone.

My nRF51822 is 2nd revision (so with 6 byte fifo) and I'd enabled hardware flowcontrol in both examples. But I still got lost bytes. To force this problem, I'd add a delay of 1 ms into the get/put loop of the example code.

After analyzing with an oscilloscope, I found out that the PC side sometimes don't considers the nRF's Rts correctly.

Here a screenshot with a correct working hardware flowcontrol.

  • running at 38.400 baud
  • upper channel = data from PC to nRF51822
  • loser channel = nRF-Rts → PC-Cts
  • PC side is minicom under Kubuntu 12.04
  • USB-RS232 adapter (Prolific Technology, Inc. PL2303 Serial Port)

Nice to see, that the nRF51822 deactivates its Rts after receiving the 2nd byte and the PC considers that with stop transmitting (at 460.800 baud, I see a third byte, but that's also ok).

image description

Here again the same with a different time scale to show, that there are really no further data while Rts is inactive.

image description

And now exactly the same szenario, but using a onboard RS232 adapter of my 10 years old Medion Notebook (running Teraterm on Windows XP):

image description

After the nRF51822 deactivates its Rts, the PC transmits 14 more bytes - that's not what he should do. I got the same results when using the RS232 of my Dell M4400 notebook docking station (running minicom under Kubuntu 12.04).

Conclusion Not every RS232 adapter works correctly with hardware flowcontrol. Seems that Prolific adapters are ok (Ftdi maybe even so).

With the Prolific USB-RS232 adapter, I'd successfully transfered data at up to 460.800 baud. I don't know why I got errors at 921.600 baud, but I've seen that there might be an issue on Nordic's side (see here). For 1 Mbaud, I failed to configure the Prolific to that baudrate (linux stty reject's this line speed, see here).

Edit: After some research, I'd decided to bought a Ftdi US232R-10 which is a FT232R based device and specified for 1 MBd transfer rate. In my tests, I'd successfully transfered about 7 GiB at 1 MBd without any error. From now, this is my favorite RS232 adapter :-)

(Don't wonder, my scope is an about 40 year old which is far away from calibration. So especially the timebase has an error of about 10%)

Related