Disclaimer: I am a novice.
I have an RS232 connection with an RFID tag reader which I am monitoring via software on a desktop computer as well as an Arduino. The device is configured with 8E1 parity. The arduino is (to the best of my knowledge) set up for 8N1 parity. Both the computer and arduino connect directly to the reader, and receive the exact same signal.
The arduino is reading a tag as follows:
10 00 62 00 10 29 C0 0F 00 39 12 C0 56 00 8D 0A
The computer is reading the same tag as follows:
30 00 E2 00 30 69 80 0F 00 59 12 80 96 00 0D 0A
With my (limited) understanding of parity, I can't figure out the conversion here.
How is the arduino interpreting these bits to obtain those values?
Best Answer
Your tag reader is sending serial data with a parity bit, and the Arduino isn't configured to expect that.
You have two options:
Configure the Arduino to read the parity bit by passing
SERIAL_8E1
as the second argument toSerial.begin()
. Once you've done this, the data should be received normally.Configure the device to not send a parity bit. (The manual implies that this is an option.)
The method that you've come up with is nonoptimal. It's likely to result in unpredictable, data-dependent read errors.