SERIN, DEBUG, and baud rates
agentile
Posts: 101
Hello,
· I am trying to figure out a way to use my computer keyboard as an input to my BS2, and also to have the PC terminal screen be a current output.· In short, I am trying to "build" a simple calculator to demonstrate the concept of overflow and also to point out the idiosyncracies in integer math.· In my manual, it states that the default 9600 baud rate is maybe too fast for the BS2.· So I reset the debug·terminal #1 to have a baud rate of 2400, and then I also set the baud rate of the SERIN command to be 2400.· Yet I get aliasing on the screen.· My guess is that DEBUG, which is actually SEROUT, has a default baud rate of 9600.· Is there a way to decrease the baud rate·of the terminal so that I can successfully·use SERIN with a baud rate of 2400?···
thanks,
Andrew
· I am trying to figure out a way to use my computer keyboard as an input to my BS2, and also to have the PC terminal screen be a current output.· In short, I am trying to "build" a simple calculator to demonstrate the concept of overflow and also to point out the idiosyncracies in integer math.· In my manual, it states that the default 9600 baud rate is maybe too fast for the BS2.· So I reset the debug·terminal #1 to have a baud rate of 2400, and then I also set the baud rate of the SERIN command to be 2400.· Yet I get aliasing on the screen.· My guess is that DEBUG, which is actually SEROUT, has a default baud rate of 9600.· Is there a way to decrease the baud rate·of the terminal so that I can successfully·use SERIN with a baud rate of 2400?···
thanks,
Andrew
Comments
Take a look at the DEBUGIN command, in the PBASIC Help File or the PBASIC Stamp Manual, as I suspect that may solve your problem. DEBUGIN is basically intended for low volume keyboard input from the normal PBASIC Stamp Debug Terminal.
Note: If you use the PBASIC Help File to obtain information on DEBUGIN, make sure to use ALL CAPS in the search argument (i.e. "DEBUGIN", not "debugin"). It will recognize the former properly, but not the latter. The powers that be claim that the necessity for CAPS is not a (Microsoft Help File) bug <shrug>, but it certainly then amounts to a rather unusual "feature" of an otherwise very helpful facility, IMHO. Additionally, I have ONLY tested this "problem" on Windows 98 SE so YMMV on other Microsoft Operating Systems.
Regards,
Bruce Bates
That said, if you're going to be using a terminal for numberic input there will be a TON of time between characters (no matter how fast you type) and the Stamp will have ample time to process the incoming stream.· So, you don't have to reduce the baud rate, but in the event you decide you want to you can start with the little demo I've attached.· To use it with your DEBUG terminal, download the program, manually open a Debug window and set to your comm port, then reset the Stamp.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
SEROUT 16, 2400, [noparse][[/noparse]"hi"]
doesn't actually send at 2400 baud, right? There's a lookup table in the manual, depending on your BS2 flavor, which will give you the number to plug in for the '2400' above to get 2400 baud.
And yes, the DEBUG and DEBUGIN statements are 'hard-wired' at 9600 baud.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Andrew