Electronic Design

BASIC STAMP 2 has optoisolated RS-232 interface

An optoisolated, half-duplex RS-232 interface can be added to Parallax’s BASIC STAMP 2 with just a handful of low-cost components (see the figure). The circuit implements a switch to change from programming (non-isolated) to normal operation (optoisolated). The operation in optoisolated mode has the same performance as the normal BASIC STAMP non-optoisolated connection using pins 1 and 2 of the internal built-in serial port.

Diodes D1 and D2 feed positivelevel power to optoisolator ISO1, which drives positive the serial out line (Rx line as seen from the host computer DTE). The negative drive on the serial out line is accomplished passively by mirroring the negative rest level of serial in line (Tx line from the host DTE) through resistor R3. This means that a real DTE device (generating ±10-V RS-232 signals) has to be connected to the RS-232 connector shown on the schematic. During receive operation, the Tx line from the DTE device drives the ISO2 LED, which turns on the common-collector phototransistor.

A switch is needed to disconnect ground for the optoisolators during programming. The BASIC STAMP isn’t able to drive the serial line and the ISO1 LED at the same time. Otherwise, a “Hardware not found” message would immediately appear when attempting to download a program.

The program and RS-232 connectors should never be connected at the same time since, during programming, the phototransistor of ISO2 is subject to a high Vce voltage with no current-limiting. Driving the ISO2 LED would burn out this transistor.

The system has been successfully tested up to 9600-baud half-duplex operation. A final caveat: As in the original BASIC STAMP built-in RS-232 interface, an intrinsic mirroring is wired between the DTE-side Rx and Tx line; i.e., any data sent to the BASIC STAMP will be immediately echoed back to the DTE device. Appropriate software should be employed to circumvent this effect.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.