Hades logoHades applet banner
software RS-232 (echo)

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit Description

Another demonstration of software RS-232 half-duplex data transmission using the PIC16 microcontrollers. In this applet, the microcontroller runs a program that listens for RS-232 input (at 300 baud, 8N1) on port A4 and echos all received characters to port B7.

To use the demo, just type characters into the terminal GUI window. If the window does not appear automatically, click on the terminal symbol to open (or close) the terminal GUI window. Because the terminal is not configured for local echo, the characters are just encoded in RS-232 format and send on the TX line of the terminal. The microcontroller will receive the character sent by the terminal on its port A4, decodes the data, and transmits it back via port B7 to the terminal, which will then display the character.

The program, based on Arizona Microchip application note 555, uses half-duplex communication. That means that the microcontroller cannot listen for incoming characters on port A4 while it is busy sending on port B7. Therefore, characters can be lost or garbled when transmitted too fast. Just insert a short pause after typing a character into the input terminal, to allow for the processing time required by the microcontroller. In this demo, the wait loops for the RS-232 transmission are hard-coded into the microcontroller program. You need to edit and re-assemble the program if you want to play with other baud-rates.

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/72-pic/30-rs232echo/echo232.html