SoftwareSerial with 8 databits and ODD Parity ... HOW to do this?

Hello from Texas... A question I need help with:
**Arduino Uno R3 serial communications works fine for 8 bits no parity... but I need 8 data bits AND ALSO an ODD PARITY bit after the 8 data bits. **
This is what I am doing now... but how to set 8 bits and PARITY ?

#include <SoftwareSerial.h>

const byte RxDataPin = 3;
const byte TxDataPin = 2;

SoftwareSerial mySerial(RxDataPin,TxDataPin);

mySerial.begin (4800);   // 8 bits, NO parity, 1 stop bit  [default]

**I can't find the software to support 8 data bits and also ODD parity. **
Can somebody please point me in the right direction to solve this...
THANK YOU!

I was going to say the Syntax is here:

But then I realized you had SoftwareSerial.
Try the AltSoftwareSerial or the NeoSoftwareSerial libraries. I don't have links handy.

Rewrite the softwareserial library :wink: A quick look at the source code on the web seems to indicate that it's not supported.

Same seems to apply to AltSoftwareSerial. I could not find NeoSoftwareSerial.

NeoSWSerial

Parity and stop bits are not currently supported. I've been thinking about adding it, but I haven't seen anybody ask about those features for a while, hehe.

Cheers,
/dev

1 Like

Wow... thanks for these replies so far.

Three Software Serial libraries... and none of them support PARITY. Yikes.

Surely this basic serial communications feature must be available from somewhere... ?

Please any suggestions or other libraries available.... thanks in advance.

Hi!

Have the same problem. Could not find SoftwareSerial version with parity check.
I've found one, but it looks like it could not run correctly at high speed rates. Looks like incorrect timing tables (((

Here it is: GitHub - ledongthuc/CustomSoftwareSerial: Alternative SoftwareSerial in Arduino. CustomSoftwareSerial library allow to configure and custom Parity Bit and Stop Bit.

P.

Surely this basic serial communications feature must be available from somewhere... ?

8 data bits plus parity is nonstandard for RS232 and so it is very unlikely that it will be implemented in modern software UART emulators.

If any of the packages support 9-bit RS232 serial, then you could easily implement even or odd parity as the 9th bit.

Why do you want to do this? Perhaps there is an easier solution to the problem.

Maybe just change to a '1284P board with two hardware serial ports.
http://www.crossroadsfencing.com/BobuinoRev17/
Here's one of several for factors I offer for 1284P boards:

The ATMega UART does support 9 bit serial, and it seems possible that the hardware parity checker would work with 8 data bits plus parity, however the data sheet is not entirely clear on that subject.

Worth a try!

Came here with the need for 38400 8e1 (Talk to a Sony Beamer).
After some experiments, i got

to work on an ATTINY85 @16Mhz PLL, a Minimal TX test was 3042 bytes.
Even better was

where the Minimal TX test was only 2178 bytes.

1 Like