DS1102

Top  Previous  Next

The DS1102 features a multi-mode, multi-channel RS232/422/485 port. Physically, the port is implemented as a single DB9M connector.

The definition of RS422 and 485 modes

To avoid any misunderstanding of what the RS422 and RS485 modes are, let's clarify that the term "RS422 mode" refers to full-duplex differential signaling interface with at least RX and TX signals, and possibly with CTS and RTS signals. Each signal is carried by a pair of "+" and "-" lines. The term "RS485 mode" refers to half-duplex differential signaling interface with RX and TX lines, where each signal is also carried by a pair of "+" and "-" lines. The RTS line of the serial port is used (within the DS1102) to control the direction, so TX and RX lines can be combined (externally) to form a two-wire bus that carries data in both directions. On a physical signal level (voltages, etc.), there is no difference between the RS422 and RS485 -- they are implemented in the same way.

RS422 and RS485 modes typically require termination circuits. No such circuits are provided within the DS1102. A simple 120Ohm resistor (added externally) is sufficient for the proper termination of one "+"/"-" pair.

Pin assignment

In the RS232 mode, the serial port of the DS1102 has 3 output and 3 input lines. In the RS422 mode, you get 2 output and 2 input line pairs. The RS485 mode offer one output line pair and one input line pair and these are not independent -- they operate in the half-duplex mode).

Internally, the DS1102 has three independent serial ports. These are controlled through the ser. object (see  "TIDE and Tibbo BASIC Manual").

Each of those ports has its own TX and RX lines. These lines are implemented in hardware and can't be "remapped". The following table shows how these RX and TX lines are connected to the DB9M:

 

ds1102_DB9M

 

 

RS232

RS422

RS485

#1

<No connection>

TX2- (output, commonly RTS-)

<No connection>

#2

RX (input)

RX- (input)

RX- (input)

#3

TX (output)

TX+ (output)

TX+ (output)

#4

TX3 (output, commonly DTR)

TX- (output)

TX- (output)

#5

Ground

Ground

Ground

#6

RX3 (input, commonly DSR)

RX+ (input)

RX+ (input)

#7

TX2 (output, commonly RTS)

TX2+ (output, commonly RTS+)

<No connection>

#8

RX2 (input, commonly CTS)

RX2+ (input, commonly CTS+)

<No connection>

#9

<No connection>

RX2- (input, commonly CTS-)

<No connection>

 

Each logical serial port of the ser. object also support RTS/CTS flow control, which is implemented in firmware (TiOS). Ser.rtsmap and ser.ctsmap properties allow you to assign any GPIO line of the DS1102 to serve as the RTS or CTS line of any logical serial port. So, TX2 and RX2 lines (pins 7 and 8) can be assigned to work as RTS and CTS lines, as is traditionally the case for RS232 ports. At the same time, these lines can be turned to function as an independent serial channel.

The same goes for the DTR and DSR lines, except they don't even "exist" from the ser. object's perspective. These lines are implemented on the application level. For example, our own "serial-over-IP" application supports these lines. Again, instead of using TX3 and RX3 (pins 4 and 6) as the lines of an independent serial channel, it is possible to use them as DTR and DSR lines, as is common.

To simplify the discussion, let's look at the serial port from the serial-over-IP application's point of view. This application defines 15 mapping options. Even in the RS232 mode, some options are redundant on the DS1102 (but not on the DS1101). Many more options are redundant in the RS422 mode. See the links below to explore further:

Mapping options for the RS232 mode

Mapping options for the RS422 mode

And where are mapping options for the RS485 mode? There are none -- but you knew this already.