Serial Interface Add-On Circuit
The Dragon Rider printed circuit board includes an area for a serial (COM port) interface, with level converters and a board-mounted female DB9 connector. Using this, the target microcontroller can be linked to a PC, terminal, modem or to other systems for control, monitoring and logging. A no-compromise design allows data rates up to the highest supported by the target and the cable or data transmission system.
Typical Parts Required
The table below lists the parts that are provided in the ECROS Technology add-on parts kit for the serial interface. Most of the parts are the sort of thing you may have in your spares drawer. The comments column should help you find substitutes; refer also to the Technical Information section, below.
| Qty. | Description | Ref. Des. | Comments |
|---|---|---|---|
| 4 | 0.1 µF capacitors | C13 to C16 | Charge-pump capacitors |
| 1 | 0.33 µF capacitor | C17 | Supply de-coupling |
| 1 | PCB-mount female DB9 | J33 | Footprint is for Kobiconn 152-3409 |
| 1 | MAX232-type level converter | U8 | Many sources available |
Price and Ordering
If you would like to purchase the Serial Interface Add-on Parts Kit from ECROS Technology, it is available at the following pricing:
Technical Information
Click here to open a window with the schematic of this add-on circuit.
The serial interface circuit is independent of all other circuitry on the Dragon Rider, having only the ground connection in common, until you connect it up. Connections are made directly with wire links.
Power to the level converter IC (U8) is suppled by pin 2 (the middle pin) of J34. Normally, you will link this to target system power at pin 3. Exceptionally, you may want to power the converter from the external power supply add-on circuit, perhaps to avoid any possibility of noise being injected from the charge-pumps in the level converter. You can do this by linking pins 1 and 2 of J34. Although no header and shunt are supplied in the kit, you can install a 3-pin header as J34 and keep your options open.
Transmit Data (TXD) and Receive Data (RXD) connections to the level converter are available at labeled pads near the bottom left corner of the LCD footprint. TXD passes through a transmit channel of the converter and appears at pin 2 of the DB9, which is RXD of the connected COM port device. TXD of the connected device arrives at pin 3 of the DB9, passes through a receive channel of the converter and appears at the RXD pad. Thus, a straight-through cable should be used between the Dragon Rider and the male COM port connector of a PC.
To connect TXD and RXD of the serial interface circuit to Port D bits 1 and 0, respectively, of the target microcontroller, simply solder wire links between the pads above and below the TXD and RXD labels on the Dragon Rider silk-screen. This turns out to be the connection needed to use the built-in UART of many of the compatible AVR devices. To use the interface with a device that does not have a UART at these port bits, or to use a software UART, you will need to figure out your own way to wire up TXD and RXD.
Hardware flow control or "hand-shaking" signals are also available at pads labeled HSO (hand-shake out) and HSI (hand-shake in). HSO passes through a transmit channel of the converter and appears at pin 8 of the DB9, which is CTS (Clear To Send) of the connected COM port device. RTS (Request To Send) of the connected device arrives at pin 7 of the DB9, passes through a receive channel of the converter and appears at the HSI pad. If you want to implement hardware flow control, wire these to general purpose port bits of your choice and drive them appropriately in software. If you read RTS as inactive at HSI, the connected device does not want to receive data from you. Similarly, if your software is not ready to receive data from the device, make CTS inactive at HSO. Note that you cannot expect flow control to take effect immediately, so be ready to receive a few more data bytes after you drop HSO. For this to work, you will need to enable hardware flow control at the connected device. If the device implements hardware flow control but you do not wire up HSO and HSI as above, you can link them together and data will flow (but without control). If the device does not implement hardware flow control or you disable it, then it is safe to leave HSO and HSI unconnected. If all this is confusing to you, just link HSO and HSI together but if you're using a high data rate be on the lookout for missed data that is sent by one side when the other side is not ready to receive it. In your microcontroller, you can watch out for this using the Data OverRun flag of the UART.
Pins 4 (DTR) and 6 (DSR) of the DB9 are wired together on the Dragon Rider PCB. So, if the PC or terminal is looking at Data Set Ready, it will go active as soon as the PC raises its own Data Terminal Ready line.