How does serin function?


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Posts
    42

    Default

    Serial data is just 1 and 0's.

    So if receving say a byte the the serial packet will have a start bit, 8 bits of data, parity bit and then Stop bits.

    But it is all done on timing, so if the pic does not receive a say a 1 within the time delay set by the baud rate between bits, then it will just take it as being a 0

    This is where you need to use the parity bit and do a calculation against the 8 data bits received.
    So basically receive your 8 bits and your parity bit, do the calculation and if incorrect request the byte again from the device sending the data.

    Regards

    Sean.
    *********************
    http://www.cncdudez.co.uk
    *********************

  2. #2
    a_critchlow's Avatar
    a_critchlow Guest

    Post parity bit

    hi thanks for that, could you elaborate on the parity bit? is this either a 1 or a zero? what calculation is there? i am planning on using 8N1 so it isnt vital but the parity may come in useful! Especially for fault tollerence.





    thanks for your time,
    andrew.

  3. #3
    Join Date
    Aug 2005
    Posts
    42

    Default

    The Parity bit can be either odd or even.

    Check this link for more details:

    http://www.lammertbies.nl/comm/info/...pecs.html#erro

    Regards

    Sean.
    *********************
    http://www.cncdudez.co.uk
    *********************

Similar Threads

  1. Serin EEPROM Programmer
    By dirtbiker5627 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 24th February 2010, 23:48
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serin question?
    By sachymo in forum General
    Replies: 5
    Last Post: - 27th July 2008, 10:04
  4. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

Members who have read this thread : 0

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