Arduino Software Serial Even Parity Check

Posted on by
Arduino Serial Parity

I'm trying to use Arduino's SoftwareSerial to communicate with a RS-422 device. Game Motogp 2011 Untuk Pc there. I use to convert 422 to TTL. The device is 8bit - odd parity - 1 stop bit. I've tried to mod the softwareserial library using: Changed the parity bit calculation in the write function to odd instead of even. Couple of problems: First, if I use the exact mod suggested by pylon [the 4th comment] on the recv function, while trying to upload the sketch I get: /var/folders/st/vmhkh5t57592ln_zhkyfq2q80000gn/T//cct5EjNP.s: Assembler messages: /var/folders/st/vmhkh5t57592ln_zhkyfq2q80000gn/T//cct5EjNP.s:243: Error: register r24, r26, r28 or r30 required /var/folders/st/vmhkh5t57592ln_zhkyfq2q80000gn/T//cct5EjNP.s:263: Error: register r24, r26, r28 or r30 required Have no idea why.

Arduino Software Serial Even Parity Check

But if I leave the function as is, and only changing this: // skip the parity bit tunedDelay(_rx_delay_stopbit); DebugPulse(_DEBUG_PIN2, 1); // skip the stop bit tunedDelay(_rx_delay_stopbit); DebugPulse(_DEBUG_PIN2, 1); to this: // skip the 2 stop bits tunedDelay(_rx_delay_stopbit*2); DebugPulse(_DEBUG_PIN2, 1); I can upload the sketch and even start receiving true and correct data on my serial. The second problem, is that no matter what I do - I can't get the write function to work. The device doesn't respond to any input except that in the second I try to send something to that device over the serial, I stop getting nice and clean data on my recieve channel, instead I get clutter. [BTW, in that situation - if send some 'new line' 0D, it brings back the normal data on the recieve channel.] *-I'm using Arduino 1.0.1 EDIT: I don't know if it's important or not, but I'm using inverse_logic for the receive function to work. Any ideas will be more than welcome!

I currently have a setup where I take serial output from Arduino 1 and push it through a transmitter to the receiver of Arduino 2 where it is fed back into the serial.

I have an Arduino Mega communicating with a Bluetooth adapter through one of the auxiliary hardware serial ports. It works, but there appears to be a corruption rate of approximately 1 in 200 small packets.

In other words, about 0.5% of the packets are being corrupted, it seems. I have the option of configuring the serial mode on both ends. While I cannot decrease the baud rate for bandwidth reasons, I do have enough room to enable parity or a larger stop bit if that would help.

Comments are closed.