Shop OBEX P1 Docs P2 Docs Learn Events
bs2 serial problems — Parallax Forums

bs2 serial problems

weydevweydev Posts: 9
edited 2006-05-09 17:50 in BASIC Stamp
i am having trouble swapping between inverted and non inverted baudmodes.

' {$STAMP BS2}
' {$PBASIC 2.5}
· 'display constants

n96n········ CON 16468
n24n········ CON 16780
n24n_t······ CON 396
n96n_t······ CON 84
start:
SEROUT 16 ,n96n, [noparse][[/noparse]"9600· inverted",CR,LF]
PAUSE 500
SEROUT 16 ,n24n, [noparse][[/noparse]"2400· inverted",CR,LF]
PAUSE 500
SEROUT 16 ,n24n_t, [noparse][[/noparse]"2400 non inverted",CR,LF]
PAUSE 500
SEROUT 16 ,n96_t, [noparse][[/noparse]"9600 non inverted",CR,LF]
PAUSE 500
GOTO start
END

using the above code and the debug window i would expect only one line of readable data to be displayed.

but as long as i match the baud rate i see both the inverted and non inverted data.

the above is just test code what i am actually trying to do is interface with a message display using a max232cpe.

thanks for the help

Comments

  • KlasKlas Posts: 3
    edited 2006-05-09 15:50
    The reason is that when you use pin 16 (the programming/debug pin) the compiler ignores the baudmode and default to values that are debugwindow-friendly. On other pins it will probably work

    From the Reference manual 2.2, page 419
    "If the dedicated serial port (Tpin=16) is used, the data is inverted and driven regardless of the baudmode setting."
  • weydevweydev Posts: 9
    edited 2006-05-09 17:50
    ·i didnt spot that in the manual and it certainly would explain alot of what i was seeing.
    thanks klas i will have another go tomorrow.
Sign In or Register to comment.