Shop OBEX P1 Docs P2 Docs Learn Events
7-bit (7/1/E) w/Schenk's FDS? — Parallax Forums

7-bit (7/1/E) w/Schenk's FDS?

luftphotoluftphoto Posts: 5
edited 2010-09-14 07:00 in Propeller 1
I've hit a brick wall here. Help!

Almost a year ago I posted about a small project I was working on that would need 7-bit serial comm capability. Somewhere along the way someone gave me, or I somehow found a modified version of "full duplex serial", modified by Andy Schenk (and can be downloaded here: http://forums.parallax.com/forums/attach.aspx?a=29977 ).

The modded version of FDS works great for transmit but no matter what I try I can't force it to receive 7-bits, even forcing it to ignore parity, etc... I use this .spin for output and it's absolutely perfect so I'd like to just hack the receive code if possible. Any ideas?

Comments

  • AribaAriba Posts: 2,690
    edited 2009-11-11 06:26
    Hello luftphoto

    If you have 7 bits with Even parity, then these are 8 bits total. On transmit the driver can replace the highest bit with the right parity. On receive the highest bit representate the parity that the sender on the other side sends, but this bit is not checked against correctness.
    So you get 8 bits bit 6..0 = 7bit Data, bit 7 = parity. If you don't want check the parity, then you can ignore it with:

    data := <obj>.rx & %01111111

    This masks bit 6..0 and set bit 7 to zero. <obj> is the name of your included serial object.

    Andy
  • luftphotoluftphoto Posts: 5
    edited 2009-11-11 14:11
    Andy, thanks! I was heading in that direction but was concentrating on the assembly part of the code, it worked fine.

    If anyone else needs the info, I changed the code here:

    PUB rxcheck : rxbyte

    '' Check if byte received (never waits)
    '' returns -1 if no byte received, $00..$FF if byte

    rxbyte--
    if rx_tail <> rx_head
    rxbyte := rx_buffer[noparse][[/noparse]rx_tail] & %01111111
    rx_tail := (rx_tail + 1) & constant(RXBUFFSZ-1)
  • gpostgpost Posts: 5
    edited 2010-09-13 16:13
    I am looking for a serial object that can handle 7 bit, 1 start, 1 stop, even parity.

    @luftphoto: Care to post your complete code? (can't seem to follow original link)
  • AribaAriba Posts: 2,690
    edited 2010-09-13 19:57
    I have attached it.

    But the object sends 2 stop bits, I hope this is not a problem.

    Andy
  • gpostgpost Posts: 5
    edited 2010-09-14 07:00
    Thanks for the code Ariba. I will see if I can figure out how modify the code for 1 start bit and 1 stop bit. A bit of a daunting task since it's been 7 years since I have looked at anything that resembles assembly :)
Sign In or Register to comment.