Here's a sample program, thrown together for fun this lunchtime, to demonstrate bi-directional dialogue with a PC running something like Hyperterminal. It runs at 300 baud so almost any PIC will run it without an Xtal or Resonator.
Yes, whatever you type is echoed back to you as feedback. UPPERCASE and lowercase and cOmBINatIOns are handled with reasonably idot-proof command interpretation...
You can even use the BACKSPACE Key and have the PIC perform rudimentary line editing.
The object of the program is to demostrate how commands can be passed from the PC User and acted upon by the PIC.
PIC has five LED's which can be remote controlled in a variety of ways with commands like ON, OFF, BLINK, SWEEP and BEER. The major commands have sub-parameters which can be added to make control more interesting. Plenty of expansion for you to do your own thing.
Example:
ON Switch ON all LEDs
ON 2 Switch ON LED number 2
ON 4 7 Switch ON LED number 4 for 7 seconds
BLINK 1 15 Blink LED number 1 15 times
OFF 1 Switch OFF LED number 1
SWEEP 25 Sequentially Sweep all LEDs 25 times
Try to break it (if you can) by typing combinations of garbage....
Full instructions in the program comments.
Melanie
Bookmarks