DEBUG works, but equivalent SEROUT does not
I am running the folllowing code on my BASIC Stamp 2sx:
' {$STAMP BS2sx}
' {$PBASIC 2.5}
DIRS = $ffff
i VAR Byte
sendBytes:
FOR i = 32 TO 128 - 1
' DEBUG i
SEROUT 16, 84,
PAUSE 1000
NEXT
GOTO sendBytes
The BoE's serial connector is connected to my PC's COM port, and I'm running HyperTerminal at 9600 bps on the PC. If the DEBUG line is uncommented and SEROUT is commented out, the ASCII character set is displayed in HyperTerminal. If SEROUT is used instead of DEBUG, however, unexpected characters are displayed in HyperTerminal, mostly periods and square root signs. I have used 84 and 16468 as baudmodes, but they both result in the same problem. What is the difference between DEBUG and SEROUT that is causing the different output?
P.S. I've also tried minicom on Linux, and I've run SEROUT out pin 15, then through a MAX233A, with no improvement.
' {$STAMP BS2sx}
' {$PBASIC 2.5}
DIRS = $ffff
i VAR Byte
sendBytes:
FOR i = 32 TO 128 - 1
' DEBUG i
SEROUT 16, 84,
PAUSE 1000
NEXT
GOTO sendBytes
The BoE's serial connector is connected to my PC's COM port, and I'm running HyperTerminal at 9600 bps on the PC. If the DEBUG line is uncommented and SEROUT is commented out, the ASCII character set is displayed in HyperTerminal. If SEROUT is used instead of DEBUG, however, unexpected characters are displayed in HyperTerminal, mostly periods and square root signs. I have used 84 and 16468 as baudmodes, but they both result in the same problem. What is the difference between DEBUG and SEROUT that is causing the different output?
P.S. I've also tried minicom on Linux, and I've run SEROUT out pin 15, then through a MAX233A, with no improvement.
Comments
The baud rate is incorrect for the BS2sx…Please see the SEROUT command in the Help File or the BASIC Stamp Manual for getting the correct value there. Also, you should use inverted baud mode since that is what the DEBUG command uses (Port 16 is locked that way). Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
you should have SEROUT 16,16624,[noparse][[/noparse]i]
Jeff T.