bs2 serial problems
weydev
Posts: 9
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
' {$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
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."
thanks klas i will have another go tomorrow.