Go Down

Topic: Handling serial parity errors (Read 1 time) previous topic - next topic

CrossRoads

You're right, not much documented as to what happens when there is an incoming error. Have to get one of the real programmers involved.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

MCDO

What's the best way to get in contact with them?

CrossRoads

Try a PM to someone like Coding Badly
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

retrolefty

#8
Nov 30, 2012, 12:52 am Last Edit: Nov 30, 2012, 12:54 am by retrolefty Reason: 1
I think what you will find is that you will have to study the datasheet for the AVR chip and learn how the various options for parity checking are enabled and how actual received parity errors are detected and signaled. Once you do understand how the underlining hardware functions, then you have to see how you will go about either modifying the existing hardware serial library to integrate this new 'feature' or write your own custom serial library. The fact that the existing hardware serial library utilizes buffered interrupt driven on received characters makes this not so simple a feature to implement.

First you have to ask yourself what you want to happen if and when a character is received that has bad parity detected? Your choices are fairly limited, either just throw the character away or via a protocol you work out with the sender of the characters, send them a signal that you received a bad character and to resend the character or the complete message. So you see it can get quite complex quite quickly and it is very much just a part of the overall serial protocol you wish to utilize between the sender and receiver of serial data.

Good luck;

Lefty

billroy

The '328p datasheet (here: http://www.atmel.com/Images/doc8161.pdf), section 19, page 176, is the place to start in understanding parity support in the hardware.

It looks like it both generates the parity bit on output and checks it on input.  See 19.7.4 for Receiver Error flags.

One issue with the Arduino buffered serial input (since you're not managing it yourself) will be knowing _which_ character was in error when the error flag lights up.

Good luck with your project.

-br

Go Up