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


Results 1 to 13 of 13

Threaded View

  1. #1

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

    I've got some 48000 bps 9,E,1 Data coming into a 12F1822 pic running at 32mhz.

    Code:
    #config
     __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _FCMEN_OFF
     __config _CONFIG2, _PLLEN_OFF & _LVP_OFF
    #ENDCONFIG 
    
    DEFINE HSER_BAUD 48000	'Set Baud rate to 48000bps
    DEFINE HSER_BITS 9		'Set to 9 bit mode
    DEFINE HSER_EVEN 1		'Set Even Parity
    DEFINE HSER_CLROERR 1   'Clear overflow error automatically  
    
    Start:						'Main program start 
    
       hserin [wait($83), str IpuData\15]		'Rxd Data
       hserout [$83, str IpuData\15]			'Txd Data
       	
    goto start
    My code basically waits for the start of a 16 byte packet and receives it then spits it back out again.

    I have been watching the data in/out with my Saleae Logic and the output seems to be one bit short!!

    Name:  LogicHch2.jpg
Views: 682
Size:  106.7 KB

    I have two serial analyzers running with the same settings. 48000 bps, 9,E,1

    The top line/channel is the incoming data which decodes correctly.
    The second line is the outgoing data but is does not decode correctly and each byte seems to be one bit short!

    If I change the settings of the Saleae output analyser to 8 bit with parity then the data is correct.
    So the pic is receiving it correctly but the hserout is wrong for some reason.
    Where is my missing bit?

    The device that receives this data ultimately is refusing it because it is not the correct length..
    Why this discrepancy? What am I missing?

    Serin2 also exhibits the same behavior?

    I had to resort to Microsoft edge to post this as Chrome still gives too many redirects errors.
    Last edited by retepsnikrep; - 9th January 2023 at 12:23.

Similar Threads

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

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