Model 100 Serial Interface: Difference between revisions

From Bitchin100 DocGarden
Jump to navigationJump to search
Line 6: Line 6:


Before the serial port can be used, it must be configured both for serial word format (data bits, stop bits, and parity) and baud rate.
Before the serial port can be used, it must be configured both for serial word format (data bits, stop bits, and parity) and baud rate.
=== Select RS232 Port ===
At any given time, either the internal modem or the external RS232 connector may be connected to the UART. This is controllable through software.
For RS232 access, port <code>$B8</code>, bit #3 must be set to 0.
For Modem access, port <code>$B8</code>, bit #3 must be set to 1.
Note that <code>$B8</code> is shared with other functions, including power control. So
RS232 00100101b
Modem 00101101b


=== Serial Word Format ===
=== Serial Word Format ===

Revision as of 17:43, 1 February 2009

Overview

The BASIC ROM provides access to the serial port. BASIC ROM support is well documented elsewhere. This article covers direct use of the IM6402 UART on the Model 100 and Tandy 102.

Configuration

Before the serial port can be used, it must be configured both for serial word format (data bits, stop bits, and parity) and baud rate.

Select RS232 Port

At any given time, either the internal modem or the external RS232 connector may be connected to the UART. This is controllable through software.

For RS232 access, port $B8, bit #3 must be set to 0.

For Modem access, port $B8, bit #3 must be set to 1.

Note that $B8 is shared with other functions, including power control. So

RS232 00100101b Modem 00101101b

Serial Word Format

Port $D8 controls the serial word format.

Actually, any of $D0 → $DF can be used.

Bit Function Settings
0 Stop Bit Select 0 → 1 stop bit
1 → 2 or 1.5 stop bits (1.5 if character length is 5, 2 otherwise)
1 Even Parity Enable 0 → Odd parity
1 → Even
2 Parity Inhibit 0 → Parity
1 → No parity
4-3 Character Length Select Bits:
00 → 5
01 → 6
10 → 7
11 → 8
7-5 Unused

Baud Rate

Data Transmission

Data Reception

I/O Map

NameDirectionPort
TX Output $C8
RX Input $C8
RTS Output $BA, bit 7
CTS Input $BB, bit 4
DSR Input $BB, bit 5
DTR Output $BA, bit 6

Direction indicates both data flow, and whether to use an IN or OUT instruction to read/write to the given pin.