Shop OBEX P1 Docs P2 Docs Learn Events
Baud rate setting... — Parallax Forums

Baud rate setting...

FORDFORD Posts: 221
edited 2007-01-12 14:02 in BASIC Stamp
Hi All,
I am trying to interface with some equipment which uses the following serial settings...
4800 bps.
Even parity.
8 data bits.
1·stop bit.
(4800,E,8,1).

My problem is that the stamp manual doesnt give any info for data which is 8 bit, even parity.

Is there a trick to making it compatable with even parity ?...

Have I missed something ?...

or is it not possible ?.

Cheers,
Chris.
Western Australia.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-01-12 01:53
    Stamps can only do No Parity (using SERIN, SEROUT)

    Post Edit [noparse][[/noparse]011207] --
    Using SERIN/SEROUT, Stamps can only do 8-N-1 or 7-E-1

    Post Edited (PJ Allen) : 1/12/2007 10:55:07 PM GMT
  • FORDFORD Posts: 221
    edited 2007-01-12 01:54
    I may have rushed that,

    I think the manufacturer must mean 7 data bits, even parity, they have it written as 8,E,1.
    I will try changing the baud rate setting to suit 7,E,1 and see how it goes.

    Cheers,

    Chris
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-01-12 02:47
    If it's 7-E-1, then you could send that as 8-N-1, using the MSB as the Parity bit.· [noparse][[/noparse]Start bit, 7 data bit (b0-b6), parity as 8th bit (b7), stop bit.]· So, for example:
    1. to send % 000 1001, as 8-E-1,·then SEROUT·% 0000 1001 ($09)
    2. to send % 011 0111, as 8-E-1, then SEROUT % 1011 0111 ($B7)

    Stands to reason, yes?

    [noparse][[/noparse]Remember, the data is sent/received least significant bit FIRST.]

    Post Edit [noparse][[/noparse]011207] -- "Woe is me, for I am undone."· One needn't go to all this trouble to fab 7-E-1, as the Stamp already supports that.· But, if one wanted to do ODD parity (7-O-1)... they'd need only to change the Parity bits in the examples above.



    Post Edited (PJ Allen) : 1/12/2007 10:58:03 PM GMT
  • FORDFORD Posts: 221
    edited 2007-01-12 03:25
    Thanks PJ,

    BTW, I'm using a bs2p.

    I am now sure that it will be transmitting 8 data bits.

    If this is the case, i dont think it will be possible to even add an extra parity bit in code, because the stop bit will take the place of the parity bit, so I'm snookered.

    I was thinking I could still just use a stamp for rx, but I guess the same will be the case on the rx line, as the tx equipment will be sending data as E,8,1, and the parity bit will be where the stamp expects a stop bit. Looks like the code you sent me will need to be used on an sx.

    I'll try to knock up an sx program which will interface between the stamp and the comms to the equipment, and convert the E,8,1 to N,8,1.

    Cheers,

    Chris
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-01-12 08:50
    Chris -

    I would use one of the following BAUDEMODES for the BS-2P:

    Inverted· True
    · 25076·· 8692

    Let us know how you make out with that. The Stamp has no problem with EVEN parity.

    Regards,

    Bruce Bates
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-01-12 13:02
    I think 8-E-1 is not supported.
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-01-12 14:02
    8-N-1 is supported, as is 7-E-1. Check out the baud-mode modifiers and the baud-mode table under SEROUT in the Parallax Help.
Sign In or Register to comment.