View Full Version : Can you Communicate with UART?
08-16-2005, 04:28 AM
I would really like to have my·BS2 run a program that communicates with the PC.· Obviously (for program and debug) it has UART capabilities, however, I haven't seen anything in the BS2 instruction set that uses the capabilities.
Is there a way to interface with the UART on the Interpreter Chip?
08-16-2005, 04:35 AM
You can use pin 16 which is a software pin using the SERIN/SEROUT command.· HyperTerminal is an example of software that you can use and it comes free with Windows XP.
08-16-2005, 05:51 AM
SEROUT 16, 16384, ["Hi",13]
will output "Hi" to Hyperterminal from the BS2, every 200 mSecs.
P.S. -- edit 8/16/2005 -- the "16384" baud-mode is incorrect for 9600 baud.
I9600 CON 84 + 16384
SEROUT 16, I9600, ["Hi", 13]
This way, you can more easily change your baud rates.
The '84' tells a plain BS2 to send at 9600 baud.· The "+16384" says to use "Inverted" mode -- which is needed if you have a MAX232 circuit in there, which the BS2 does.
Post Edited (allanlane5) : 8/16/2005 12:48:15 PM GMT
08-16-2005, 11:35 PM
<nitpick>Well, I don't think you need to explicitly say inverted, since you're using pin 16...· Couldn't resist...</nitpick>
08-17-2005, 02:32 AM
Good point, Yanroy. On pin 16 you don't need to say 'Inverted', it's automatically 'Inverted'. I still do say "Inverted", though I usually have to work out the sense when I'm NOT using Pin 16.
08-17-2005, 06:34 AM
Thanks for the help guys...It's workin like a champ.