Hades logo    Hades applet banner

TAMS / Java / Hades / applets (print version): contents | previous | next

RS232 receiver demo

RS232 receiver demo screenshot


This applet demonstrates the receiver part of a serial communications interface. The circuit converts an incoming serial RS-232 protocol data stream into a parallel 8-bit ASCII data stream. The RS-232 stream is expected to use the following parameters: 1200 baud, 8 data-bits, 1 parity-bit (which is ignored), and 2 stop-bits (or 1200 8P2 for short). For the corresonding parallel-to-serial converter, see the transmitter demonstration applet.

The circuit shown here consists of a serial terminal component which generates the serial RS-232 data, the actual receiver subdesign for the serial-to-parallel conversion, and a 'parallel terminal' (similar to a printer port but with on-screen output). The counters are just for visualization, because the repainting will be much to slow to follow the serial communication data, despite the comparatively slow baud-rate of 1200 baud.

When the applet is first loaded, it will open two extra windows, one for each of the terminals. Whenever you type into the 'serial terminal' window, the terminal will output the corresponding ASCII data on its TX output port. (You can change the communication parameters of the terminal via its 'configure' dialog. The default values used in this applet are 1200 baud, 8 data bits, parity bit, and 2 stopbits.)

The default of an idle RS-232 line is high. The receiver subdesign detects the start-bit that preceeds the data bits of each RS-232 character. It is clocked with the baud-rate, and clocks one bit per clock period into an 8-bit shift-register. Once all data bits have been read, the data is read-out from the shift-register and transferred to an output-buffer register, which in turn drives the parallel data outputs of the receiver. A short strobe pulse on the strobe output signals that a new character has arrived.

To show or hide the terminal windows, simply click on the terminal symbols in the schematics editor. On Windows systems you may have to shuffle the browser and terminal windows around, so that you can type characters into the serial terminal while still watching the main schematics window and the parallel terminal. Unfortunately, some web-browsers still have bugs with the handling of keyboard focus for Java applets. If necessary, bring the 'serial terminal' window into the front and try a mouse-click into the window to guarantee that the window has the keyboard focus, before you start typing into the window.

For a screenshot of the transmitter demonstration with both terminal windows open, click here

The following image shows an example waveform while receiving the input data (D0..D7) = (00000100), corresponding to the ASCII space char:


Run the applet | Run the editor (via Webstart)

Impressum | 24.11.06