HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    458


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    The hardware uart can't do 9E1... that would require 10 bits.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    Maybe I mislead you then, sorry I mean 8,E,1 (1 start bit, 8 data bits, 1 parity bit and one stop bit)

    The below sort of works just moving the 9th bit and the 8 Bit data straight across from the RX to TX.

    The receiving device is now accepting the input but Saleae logic still shows errors in the data the PIC is outputting???
    Something weird is going on..


    Code:
    Start:						'Main program start    
    
       do while PIR1.5 = 0                        'Wait for RX  data
       loop   
       
       do while PIR1.4 = 0                        'Wait for TX to be ready
       loop
       
       TXSTA.0 = RCSTA.0
       TXREG = RCREG
    	
    goto start

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    The receiving device is now accepting the input but Saleae logic still shows errors in the data the PIC is outputting???
    Something weird is going on..
    If you still have the protocol decoder set to 9E1 then I believe that would be the problem since the output from the PIC is 8E1 (11bits total). Likely the input is 8E1 as well, don't you think?

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    Yes but setting the decoder to 8E1 on the input gives parity errors. ???

    Attached is some logic 1.2.40 data. The top line is the incoming data.

    Perhaps some kind soul could have a look at it and see what they make of it.
    Have I got the baud rate/parity etc right for the incoming data decoder?
    I've tried loads of variations!!

    The shortest pulse is about 20us

    Note the output data is now at least the same length as the input and the receiving device seems to accept it, but the output decoder with the same settings as the input gives errors!!!

    LogicData.zip
    Last edited by retepsnikrep; - 10th January 2023 at 08:31.

  5. #5
    Join Date
    Aug 2011
    Posts
    458


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    If you set both channels of the protocol decoders to 8 data bits, odd parity, 1 stop then the errors go away (8O1), but I don't know about the data.

    Are you sure about the format? You don't include the parity bit in the count of data bits. Typical formats would be 8N1, 8E1, or 8O1.
    Normally, in 9-bit mode there's no parity used (9N1).

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    Yeah, like tumbleweed says, it does seem to be ODD parity, not EVEN.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: HSERIN HSEROUT 9BIT & PARITY (Output is Losing a bit!)

    I think you are both right. Thanks a lot.
    I had tried lots of combos!!! But missed odd parity...

Similar Threads

  1. Replies: 8
    Last Post: - 11th July 2011, 21:20
  2. Loading a BIT array, losing my mind!
    By PlantBob in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th January 2011, 14:26
  3. Hserin & Hserout - Trying to blink an LED
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 24th May 2010, 13:25
  4. Bit/Byte array for Hserin/Hserout
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd September 2006, 00:07
  5. 8 data and parity using HSERIN, HSEROUT
    By Smity42 in forum Serial
    Replies: 2
    Last Post: - 3rd April 2006, 02:45

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