Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 19th October 2005, 08:35 PM   (permalink)
Default Parity checking

From a textbook:

"The parity bit is chosen so that the total number of 1's in a coded frame is even. We say that the coded frame has even parity."

From a basic explanation in a Web site:

"Computing parity involves counting the number of ones in a unit of data, and adding either a zero or a one (called a parity bit) to make the count even (for even parity) or odd (for odd parity).

For example, 1001 is a 4-bit data unit containing two one bits; since that is an even number, a zero would be added to maintain even parity,...."

To my surprise, :!: from AN 160 from Linx Technologies:

"A parity check is accomplished by adding all of the '1's in a string of bits. For even parity, if the number is even, then the parity bit is set, otherwise it is not."

(Bold formatting is mine)

Comments anyone?
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Old 19th October 2005, 10:16 PM   (permalink)
Default

That last bit can only be true if they are talking about a status bit in a status register. A status bit can be chosen to indicate either even or odd parity.
tkbits is offline  
Old 19th October 2005, 11:17 PM   (permalink)
Default Parity checking

Sorry, I should have added the whole text. The AN it's not mentioning any status register but the byte to be xmitted.


Quote:
The simplest form of error detection is the parity check. A parity check is accomplished by adding all of the '1's in a string of bits. For Even Parity, if the number is even, then the parity bit is set, otherwise it is not. For Odd Parity, if the number is odd, then
the parity bit is set.

Example 1:

In this example, we will calculate the parity of a byte that is to be transmitted using Even Parity. During transmission, one of the bits gets reversed. The
receiver catches this through the parity check at the reception end.

Transmitter:

10101010

There is an even number of '1's, so the parity bit is set and the byte is transmitted as follows:

101010101 <<<here you have a 5th bit which contradicts the concept of even counting
Receiver:

001010101

The last bit is not used in the parity calculation since it is the parity bit from the transmitter. Calculating parity on the received byte yields an odd number of
'1's and the parity is '0'. Since the receiver's parity calculation does not match the transmitter's calculation, the byte is determined to be errant and is thrown out.
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Old 20th October 2005, 09:15 AM   (permalink)
Default

Are you planning using a parity bit for something?, you should be aware that it offers the least amount of checking possible - and isn't really worth bothering with?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 20th October 2005, 11:04 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Are you planning using a parity bit for something?, you should be aware that it offers the least amount of checking possible - and isn't really worth bothering with?.
No. Hamming code 7,4 instead, complemented with repetition (thrice) followed with majority vote. Could sound overkill for my IR link between two PICs but they are easily implemented in software.
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Old 20th October 2005, 11:20 AM   (permalink)
Default

Quote:
Originally Posted by atferrari
Quote:
Originally Posted by Nigel Goodwin
Are you planning using a parity bit for something?, you should be aware that it offers the least amount of checking possible - and isn't really worth bothering with?.
No. Hamming code 7,4 instead, complemented with repetition (thrice) followed with majority vote. Could sound overkill for my IR link between two PICs but they are easily implemented in software.
As you're writing both ends of the link, then you can deal with the parity bit exactly as you wish - but it seems rather pointless?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 20th October 2005, 08:42 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
As you're writing both ends of the link, then you can deal with the parity bit exactly as you wish...
Sure. I'am the 100% of the development team, only using parity check to build the 7,4 Hamming code, later complemented as described.

BTW, NIgel, could you suggest a simple / practical way to check the error correction part :?: keeping in mind it is a non-outdoors bot where the "one way" IR link between the brains and each leg is aimed basically to control motors.

Gracias.
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Old 20th October 2005, 09:48 PM   (permalink)
Default

Quote:
Originally Posted by atferrari
Quote:
Originally Posted by Nigel Goodwin
As you're writing both ends of the link, then you can deal with the parity bit exactly as you wish...
Sure. I'am the 100% of the development team, only using parity check to build the 7,4 Hamming code, later complemented as described.

BTW, NIgel, could you suggest a simple / practical way to check the error correction part :?: keeping in mind it is a non-outdoors bot where the "one way" IR link between the brains and each leg is aimed basically to control motors.
You might try sending a checksum - it doesn't have the capability of correcting errors, but it is a good way of showing an error exists.

I'm presuming you're continuously sending data?, the robot should enter a 'safe mode' if it doesn't get valid data within a certain time - this means it will 'fail safe'.

However, because you can continually send data (which will mostly be the same), missing the occasional byte or two doesn't really matter.

Your TV remote does no error checking, does that work well enough or not?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 20th October 2005, 10:12 PM   (permalink)
Default Error checking/correction

The brains will tell the legs when to start / stop / reverse. No continuous emision planned. Too much power to save in that way!

No TV remote used, just an IR link based in the SIRC protocol from brains to legs.
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Old 21st October 2005, 09:20 AM   (permalink)
Default Re: Error checking/correction

Quote:
Originally Posted by atferrari
The brains will tell the legs when to start / stop / reverse. No continuous emision planned. Too much power to save in that way!
In that case I suggest you use transceivers and a two way link!.

Quote:

No TV remote used, just an IR link based in the SIRC protocol from brains to legs.
I meant on your TV! - that works fine doesn't it?, and no error checking!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 21st October 2005, 10:34 AM   (permalink)
Default Re: Error checking/correction

Quote:
Originally Posted by Nigel Goodwin
I meant on your TV! - that works fine doesn't it?, and no error checking!.
Oh, yes. You are right :!: There is hope after all...

Thanks for your time and good disposition.

Sure I will post the outcome.
__________________
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
atferrari is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:09 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker