BS2 with Hyperterminal question
TTS
Posts: 4
HI;
I'm new to the Basic stamp and I have a question about using the Serout/Serin
commands to communicate with Hyperterminal. I just want basic functionality
but I can't get it·to work. The very simple one-line·program·below illustrates the issue.
SEROUT 16,16468,[noparse][[/noparse]65]
I also tried sending the info formated in ASCII.
It should send an "A" to the screen and works fine with the Debug screen in the
BS2 editor. But, when I close the debug window and run Hyperterminal set up like
the Debug terminal (i.e: Com 4, 9600 baud, 8N1, no flow control, VT100, or even TTY)
and press the 'Reset' button on the BS2, the screen shows nothing. I know it has to be
something very simple I'm overlooking.
Any thoughts?·Again, it works fine in the Debug window of the editor.
Thanks
I'm new to the Basic stamp and I have a question about using the Serout/Serin
commands to communicate with Hyperterminal. I just want basic functionality
but I can't get it·to work. The very simple one-line·program·below illustrates the issue.
SEROUT 16,16468,[noparse][[/noparse]65]
I also tried sending the info formated in ASCII.
It should send an "A" to the screen and works fine with the Debug screen in the
BS2 editor. But, when I close the debug window and run Hyperterminal set up like
the Debug terminal (i.e: Com 4, 9600 baud, 8N1, no flow control, VT100, or even TTY)
and press the 'Reset' button on the BS2, the screen shows nothing. I know it has to be
something very simple I'm overlooking.
Any thoughts?·Again, it works fine in the Debug window of the editor.
Thanks
Comments
Change your baudmode parameter from 16468 to 84. Normally, inverted mode would be for using a regular Stamp pin to talk to a PC-type device.
Also, you may need pins 7-8 of the serial connector jumpered together at the PC end to let Hyperterminal know to pay attention!
Cheers
One way to determine what's going wrong is:
MyVal VAR BYTE
MyVal = 0
MAIN:
SEROUT 16, 84, [noparse][[/noparse]"Hi. ", DEC MyVal, CR]
MyVal = MyVal + 1
pause 1000 ' Needed to prevent FLOOD of data
GOTO MAIN
Just a couple of hopefully helpful comments on the test program. This is how it appears now:
MyVal VAR BYTE
MyVal = 0
MAIN:
SEROUT 16, 84, [noparse][[/noparse]"Hi. ", DEC MyVal, CR]
MyVal = MyVal + 1
pause 1000 ' Needed to prevent FLOOD of data
GOTO MAIN
Might I suggest the following:
MyVal VAR BYTE
MyVal = 0
DEBUG "RESET"
MAIN:
SEROUT 16, 84, [noparse][[/noparse]"Hi. ", DEC MyVal, CR]
MyVal = MyVal + 1
pause 1000 ' Needed to prevent FLOOD of data
GOTO MAIN
With this updated test program, you should ONLY see the word "RESET" appear once during any iteration of the program. If you see it more than once, the PBASIC Stamp is being RESET. If this is the case, please see Allan's explicit comments about the DTR line.
Second, if the test program works as expected, it will transmit sequential numbers (0-255) to the connected terminal program, be it Hyperterminal, or any other.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks to all for the help! The·BS2 is working with Hyperterminal
now. Details of fix follows:
1. The code given by Allan and Bruce could not work to debug this
·· problem because the problem was that the communications to
·· Hyperterminal was not working. Therefore no messages at all could
·· be received.
2. Chris is correct in that Stamp virtual port 16 will always use Inverted
··· signals, since this is the convention for RS232 levels as opposed to TTL
··· levels. (i.e: "1" = -12V, "0" = +5V for RS232)
3. Stamptrol was on the right track about connector jumpers, but the pertinent
··· connection is DB9-6 (DSR) and DB9-7 (RTS). These should be connected, and
····on the BS2 Carrier Board they are.
3. Allan hit it on the head with the DB9-4 (DTR) signal. Hyperterminal will send DTR on
··· DB9-4 which will hold the BS2 on the Carrier Board in reset. This line between DB9-4
··· and BS2-3 must be cut and a 0.1uF cap connected from DB9-4 to BS2-3. Also, another
··· 0.1uF cap should be added from BS2-3 to Vss.
The development boards have these caps in place but the Carrier Board does not. That is
why the communications would work with the Homework Board, etc. but not with the
Carrier Board.
Thanks again to all.
RDT
Works for a hyperterm test.
Settings: No flow control, 9600 baud (all other settings default).
Make sure you close any open Stamp IDE debug windows first.
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Thanks for the reply. The code is fine.My problem was getting the BS2 mounted on
a carrier board to talk to Hyperterminal. The solution was to add some caps in the
DB9-4 (DTR) circuit to prevent DTR sent by Hyperterminal from holding the BS2 in
"Reset". Apparently, the development boards have these caps in place but the
BS2 Carrier Board does not, so they must be added.
Thanks again.
RDT
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
a while ago but I just got around to using it last week. It makes sense they added them
to the new boards because the carrier board is great for small projects and most of those
will need to communicate to a dumb terminal for a simple human interface.
TTS
I have been following along and was curious if you can send ASCII or other data from hyperterminal to the BS2?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks for your help.