Adding Serial Ports - Technologic Systems TS-2200 User Manual

Table of Contents

Advertisement

TS-2200 User's Manual
A simpler method implemented on the TS-2200 utilizes Timer 2 in the i386EX to keep track of the bits
shifting out of the UART. It automatically turns on the transmitter, waits for the character to be sent,
then turns off the transmitter. The timer is simply initialized once based on baud rate and data format.
This totally eliminates the software overhead of controlling the RTS line manually.
To activate automatic transmitter enable, I/O location 76h bit 0 must be set to a "1", and Timer 2
initialized. When I/O location 76h bit 0 is set to "0", user software uses the RTS line to control the
RS-485 transmitter. (Set RTS, and the transmitter is enabled. Clear RTS, and it is disabled.)
To initialize Timer 2, a value of 0B2h must be written to I/O location 043h, then a 16 bit count must be
written to I/O location 042h as two consecutive bytes with least significant byte first. The count is
determined by the following equation:
For example, for 9600 baud, 8 data, no parity, 1 stop bit:
Baud divisor = 12
Bits/Character = 1 start bit + 8 data bits + 0 parity bits + 1 stop bit = 10
Count = [16 * 12 * 10] - 2 = 1918 decimal = 077Eh
The instructions in x86 assembly would then be:
MOV
AH, 0B2h
OUT
043h, AH
MOV
AH, 07Eh
OUT
042h, AH
MOV
AH, 07h
OUT
042h, AH
Serial Format
9600, No parity, 8 Data, 1 Stop
19200, No parity, 7 Data, 1 Stop
9600, Even parity, 8 Data, 2 Stop
2400, Space parity, 8 Data, 1 Stop
Note: These equations assume the standard 1.85 MHz clock is being used for baud rate generation. If
the 12.5 MHz clock is being used (see Appendix F) these equations must be modified. Contact
Technologic Systems for details.

5.5 Adding Serial Ports

If your project requires more than two serial ports, additional ports may be added via the PC/104
expansion bus. Technologic Systems currently offers a 2 serial / 1 parallel port card, and other
manufacturers sell cards with up to four additional serial ports. Typically these would be configured as
COM3 or COM4 or be assigned other non-standard I/O locations. Because DOS only directly supports
four serial ports, any additional ports beyond four will require software drivers.
The PC/104 bus has IRQ3, 4, 5, 6, 7 or 9 available for additional serial ports. If IRQ3 or 4 are to be
used on a PC/104 expansion card, then care must be taken since COM2 and COM1 also use these
IRQs, respectively. For example, if IRQ4 is used for COM3 then either COM1 must be used in a non-
interrupt fashion or only one COM port can have the interrupt enabled at a time. In any case only one
COM should have the Interrupt Enable (Bit 3 of Modem Control Reg.) set at any one time if they share
the same IRQ. This is a standard issue with the PC architecture. A better solution is to simply use
interrupts other than 3 or 4 for additional serial ports.
Count = [16 * (Baud Divisor) * (Bits/Character)] - 2
; Set timer2 mode to one-shot
; load timer2 LSB
; load timer2 MSB
[16 * 12 * 10] - 2 =
[16 * 6 * 9] - 2 =
[16 * 12 * 12] - 2 =
[16 * 48 * 11] - 2 =
Table 4 - Auto Enabled RS-485 Examples
Formula
Result (decimal)
1918
862
2302
8446
9
Technologic Systems
MSB
LSB
07h
7Eh
03h
5Eh
08h
0FEh
20h
0FEh
11/06/2000

Advertisement

Table of Contents
loading

Table of Contents