Products and Services |
One MAX232-type buffer is provided on the main board for the direct connection of EIA-232-D serial devices. This has two transmit drivers and two receivers. One pair is connected to UART1 transmit and receive data and the other pair is available to the user. (The connection to UART1 must be broken if this UART is to be used at the expansion connector.) The user can use the spare transmitter and receiver for UART0 or to add hardware flow control to UART1. A second EIA-232-D buffer can be placed in the user prototyping space if required.
The user prototyping space can also be used to implement serial interfaces other than EIA-232-D.
The ECROS Technology Display Option Kit includes the bare minimum you need to interface the Prototyping System to a EIA-232-D serial device, such as a PC's COM port. Hardware flow control can be added with four wire jumpers. A cable from the board's 10-pin header to the COM port's DB9 is included.
|
Ref. Des. |
Description |
Source |
Part # |
Qty |
|---|---|---|---|---|
|
U2 |
ST232 driver/receiver |
Mouser (page 217) |
511-ST232ACN |
1 |
|
C7 - 11 |
Capacitor, 0.1µF |
Mouser (page 478) |
80-C410C104M5U |
5 |
|
J2 |
Header, 10-pin |
Mouser (page 691) |
517-6121TN |
1 |
|
- |
Header socket, IDC |
Mouser (page 664) |
164-9006 |
1 |
|
- |
Ribbon cable, 10-way |
Mouser (page 562) |
172-1010 |
6 ft. |
|
- |
DB9 Female, IDC |
Mouser (page 658) |
571-7473034 |
1 |
The Serial Interface Option Kit is available from ECROS Technology.
Click
this button for general ordering information, shipping charges, tax, etc.
After soldering in U2 and the five 0.1µF capacitors clustered around it, it is worth checking the voltages at pins 2 and 6 to make sure the charge pumps are running. This assumes, of course, that you have the power supply in place and are ready to turn it on. You will see almost +10 volts at pin 2 and almost -10 volts at pin 6.
Unfortunately, I failed to mark pin 1 of the ten-pin serial port header on the board silkscreen. When you are assembling the board, it is easy to identify pin 1 as the pad is square, rather than round. You might want to mark pin 1 yourself before you assemble the board into a box. On the IDC socket, pin 1 is marked with a little raised triangle on one face. When you assemble the socket to the ribbon cable, make sure that the marked edge of the cable (usually a red stripe) is on the side of this pin 1 marker. At the other end, make sure that the marked edge is on the same side as pin 1 of the DB9. The pin numbers here are on the face of the connector but require good eyesight or a magnifying glass to see clearly. Back to the ten-pin header and socket, I recommend that you arrange things so that the cable leads straight away from the board, rather than folding over the top of the socket. This will help you always put it on the right way round. Try it in place before you squeeze the IDC socket closed. The marked edge of the cable must be on the side of pin 1, which is the side away from the power supply. If you plan to use the strain relief clip which is supplied, you have to put the ribbon cable into the connector itself from the "wrong" side. The marked edge must still be away from the power supply, but the cable will leave the connector over the board, not away from it. When you have squeezed the connector closed, fold the cable tightly over the top and put the strain relief over it and squeeze that down also.
U2 contains two EIA-232D transmitters and two receivers. One pair is pre-wired between UART1 transmit and receive data of the MCU and the 10-pin header J2. UART1 is ready to use (without hardware flow control). The other pair is available to the user at test points TI (transmitter input), TO (transmitter output), RI (receiver input) and RO (receiver output). These are close to one end of U2.
To use the spare transmitter/receiver pair for UART0, wire PA5 (at the main expansion connector) to TI and PA4 to RO. UART0 now transmits at EIA-232D levels at TO and similarly receives at RI. Remember to arrange for these to cross over to the receive data and transmit data signals, respectively, of the connected device. You can cross them over in the board wiring, as is done for UART1, and use a straight-through serial cable. Or, you can wire TO to TXD and RI to RXD of a DB9 connector and use a cross-over or "null modem" cable. So that you can make UART0 exactly symmetrical with the pre-wired UART1, a location is provided to mount a second 10-pin header, slightly to the left of J2. Please read Serial Interface Technical Details, below.
To use the spare transmitter/receiver pair for hardware flow control at UART1, make the following connections (but please read Serial Interface Technical Details, below):
† PD7 has been chosen here to act as RTS for UART1. Any other port could be used if PD7 is needed for some other purpose. User firmware should change the state of this port to indicate the system's readiness to receive data. Remember to "flow-off" the peer system before local buffers are completely full as the peer may require some time to respond to the signal.
The external serial device connection for UART1 is a 10-pin header. This is because of how much space a DB9 would take up on the board and how heavy and awkward the connected cable is. The pin header takes up less space and the ribbon cable that mates with it is lighter and more flexible. An adapter cable is easily made from a 10-pin IDC header socket, 10-way ribbon cable and an IDC DB9 at the other end (included in the ECROS Technology kit). If the board is mounted in an enclosure, the DB9 on the ribbon cable can be fixed to the enclosure with more freedom than if it was on the board.
The table below explains how the 10-pin serial port header is wired. It is assumed that a 10-way ribbon cable is attached with an ICD DB9 on the other end which is plugged into a DTE (such as a computer COM port, not a modem). Most of the table is concerned with the direction of the signal and what it will connect to at the other end. The second column indicates what the signal is connected to on the main board.
|
Header |
Local Signal |
Direction |
DB9 |
Connects To |
Full Name |
|---|---|---|---|---|---|
|
1 |
n/c |
----->>> |
1 |
DCD (109) |
Data Carrier Detect |
|
2 |
n/c |
----->>> |
6 |
DSR (107) |
Data Set Ready |
|
3 |
TXD of UART1 |
----->>> |
2 |
RXD (104) |
Receive Data |
|
4 |
Test Point "RTS" |
<<<----- |
7 |
RTS (105) |
Request To Send |
|
5 |
RXD of UART1 |
<<<----- |
3 |
TXD (103) |
Transmitted Data |
|
6 |
Test Point "CTS" |
----->>> |
8 |
CTS (106) |
Clear To Send |
|
7 |
Test Point "DTR" |
<<<----- |
4 |
DTR (108) |
Data Terminal Ready |
|
8 |
n/c |
----->>> |
9 |
RI (125) |
Ring Indicator |
|
9 |
ground |
n/a |
5 |
SG (102) |
Signal Ground |
Only two signals are pre-wired; any others required must be hooked up by the user. The pre-wired signals are sufficient for duplex (two-way) communication if hardware flow control is not required.
Implementing hardware flow control requires some careful thought as the EIA-232-D standard specifies only how a DCE (modem) signals to a DTE (data terminal or computer) that it can no longer accept data for transmission. It does this by putting Clear To Send (CTS, circuit 106) inactive. So, if we connect two devices neither of which is a modem (they are both DTEs) and we want hardware flow control we know that each device should look at its CTS input and stop sending data to the other device if this signal goes inactive. The Z8 Encore! has a CTS input for each UART which does exactly this. If the other device also follows this rule, we can simply connect a GPIO pin of the Z8 Encore! to pin 6 of the header, test point "CTS" (via an EIA-232-D/V.28 driver). While this signal is active, the other device may send the Z8 Encore! data. If we put the signal inactive, the other device will (soon) stop sending data.
The problem is to figure out which signal from the other device to connect to the Z8 Encore!'s CTS input. There are only two candidates, Request To Send (RTS, circuit 105) and Data Terminal Ready (DTR, circuit 108), since other than the data there are no other signals coming in our direction. EIA-232-D does not specify which of these indicates a data terminal's readiness to accept our data. Data Terminal Ready sounds as if it is meant for this purpose. However, Windows COM drivers hold DTR active as long as some application is attached to the COM port. It does not go inactive if the input buffer fills up, so it won't do for flow control. The signal actually used is RTS, even though "Request To Send" does not seem as if it should mean "I am ready to receive data". RTS is also put active when an application attaches to the COM port, but if the input buffer begins to fill up, it is put inactive. The peer system should respond by stopping transmission as soon as possible. When the input buffer drains, RTS goes active again and the peer can resume transmission. So, generally test point RTS (pin 4 of the header) should be connected to the Z8 Encore! UART's CTS input (via an EIA-232-D/V.28 receiver).
ZiLOG and Z8 Encore! are registered trademarks of ZiLOG, Inc.
Copyright © 2004, ECROS Technology, all rights reserved.