Hello,
I am using a TX2 with the libserial-dev package to communicate with a microcontroller over serial connection. When I process incoming data from the microcontroller, I am noticing that the data sometimes has the highest bit set on when it should be off. I went through and verified the data coming from the microcontroller with an oscilloscope and the waveform matches the intended signal. But when I access the data on the TX2, this is where I begin to notice my issue.
For example,
0b0000 0000 (0) is sent from the microcontroller to the TX2.
The oscilloscope shows 0b 0 0000 0000 1 where the leading 0 and trailing 1 are the start and stop bits, respectively.
When I print the data after doing a serial read on the TX2 I get 0b1000 0000 (128).
At first I thought it might be due to a noisy signal, but the data looked clean on the scope so I’m not sure what else could be causing this. Any ideas or suggestions on what the issue could be?
Thanks in advance,
Dario
hello dario.ugalde,
may I know which JetPack release you’re working with,
you may check below release tag for confirmation,
for example,
$ cat /etc/nv_tegra_release
The output from that cat command is as follows:
# R32 (release), REVISION 2.1
Also, what speed are you operating at? Do you have the ability to test with two stop bits (not all serial devices support this)? If so, try testing two stop bits.
I’m running at 57600. I tried two stop bits earlier this morning. Unfortunately doing so increased the amount of times the error would occur.
I managed to fix the issue. After reviewing the datasheets for the microcontroller I’m using, I realized that running the serial at 57600 baud rate gave a 3.3% chance of a bit error occurring. The messages I send are 100+ bits so it made sense that I was seeing this bit issue intermittently. I was able to solve my problem by reducing the baud rate to 9600 which only yields a 0.15% chance of a bit error happening.
Mostly I would expect no errors at or below 115200. Maybe part of the issue is noise…make sure you use twisted pair with shielding (I like using ethernet cable for this).