Block Check on Serial Comms.


Closed Thread
Results 1 to 5 of 5
  1. #1
    Mark Scotford's Avatar
    Mark Scotford Guest

    Default Block Check on Serial Comms.

    Newbie about to use Serial for 1st time (be gentle with me), I have to follow somebody else's protocol on a RS485 system. and they have specified that I use a Block Check at the end of the data string. They want "Even Parity Check (exclusive -OR)" is there anywhere I can find information on explaining to a non-maths person what this means, in simple terms?

  2. #2
    Mark Scotford's Avatar
    Mark Scotford Guest


    Did you find this post helpful? Yes | No

    Default Help me out, please?

    Come on, help me out no replies yet, though lots of views, I asked this same question some time ago and the same thing happened. Is it a stupid question or is it unaswerable in its present form, please let me know?

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Probably just one of those obvious instances where everyone assumes that someone else is going to answer this one and nobody does...

    You have a string of Data (in my example this is contained in an array DataP which is a block 16 characters deep)... You now EXCLUSIVE OR it all together to produce a CHECK BYTE (in the example we call the byte PARITYCHECK)...

    Code:
    	CounterA var BYTE
    	DataP var BYTE [16]
    	ParityCheck var BYTE
    
    
    	ParityCheck=0
    	For CounterA=0 to 15
    		ParityCheck=ParityCheck^DataP(CounterA)
    		Next CounterA
    In our above example, the ParityCheck byte contains the Exclusive OR sum of all the characters in the Block. When you transmit your Block, the ParityCheck Byte is the last character you send. This also goes by the name of LONGDITUDINAL PARITY.

    Why is this used? By combining a Longditudinal Parity BYTE along with EVEN or ODD Frame Parity on each Byte, you can detect what Bit in a Block of Data has been corrupted and Error-Correct appropriately - which can't be done if you use EVEN or ODD Parity on it's own.

    The logical EXCLUSIVE OR character ^ is fundamental in computing parity, you can look up it's use in the PBP manual.

    When transmitting, set up your Serial Protocol for appropriate EVEN PARITY. Again check in your PBP manual for the Serial Command you are going to use (SEROUT, SEROUT2, DEBUG, HSEROUT) for details on setting up the number of Data Bits and Parity.

    For more information, do an Internet Search... or try here as a starter...

    http://home.apu.edu/~jcox/projects/individual/Vu/

  4. #4
    Mark Scotford's Avatar
    Mark Scotford Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie, I'll marry you.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    *Smiles* Happily single and swinging... To qualify for the short-list, you'll have to email me a pic of proof that you're the proud owner of a really BIG...

    ...

    ...

    ...

    Bank Statement (content - not paper size!) - now, what were you thinking I meant?

    If you guys want to know the truth about us girls... from an internet search go dowload the cartoon movie lamour.asf (1.7Mb)... or try here...

    http://www.ausgamers.com/files/details/html/793

Similar Threads

  1. config bits
    By brianD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th February 2010, 14:45
  2. Setting up internal clock correctly?
    By JohnM in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th March 2008, 21:29
  3. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 01:55
  4. Replies: 2
    Last Post: - 23rd July 2006, 09:16
  5. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 16:26

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts