Home/Support/Support Forum/WHy do I get garbage data on serial port?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

WHy do I get garbage data on serial port?

0 votes
I have a sensor supplying data on serial port of BL4s220 SBC. The baud rate is 19200 8N1. I have set the port input buffer size as 255. When I start the device I get 5 to 6 frames of good data. After this the garbage data starts coming in. I have not been able to locate source of this problem. Please Help.
Example Data
Alt:706 IAS:209 Pitch:0.450000 Alt:706 IAS:210
Pitch:0.444444 Alt:706 IAS:211 Pitch:0.433333 Alt:706 IAS:211

Pitch: 182.038894
asked Feb 8, 2016 in Rabbit Software by siddarth New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
How are you receiving and printing the data? Which function do you use to read from the serial port? Are you checking to ensure that you actually received data before printing it? The serBgetc() function returns -1 if there isn't any data available to read.

Post your code and we can try to help you troubleshoot it.
answered Feb 29, 2016 by TomCollins Veteran of the Digi Community (2,303 points)
Garbage data on Serial Port