Table 14-a. serial port operating modes – Maxim Integrated Secure Microcontroller User Manual

Page 116

Advertising
background image

Secure Microcontroller User’s Guide

116 of 187

Table 14-A. Serial Port Operating Modes

MODE

SYNC/ASYNC

BAUD CLOCK

DATA

BITS

START/STOP

9TH DATA BIT

FUNCTION

0

SYNC

12 t

CLK

8

None

None

1

ASYNC

Timer 1 Overflow

8

1 Start, 1 Stop

None

2

ASYNC

32 t

CLK

or 64 t

CLK

9

1 Start, 1 Stop

0, 1, or parity

3

ASYNC

Timer 1 Overflow

9

1 Start, 1 Stop

0, 1, or parity

Mode 1 is a 10-bit asynchronous mode using 8-bit words, one start bit, and one stop bit. The time base is
generated from the Timer 1 overflow and is therefore fully programmable. A user simply loads the timer
with a value that generates the required time interval at its overflow. This is the most common mode of
communicating with a PC COM port or similar device. When talking to a PC in Mode 1, the PC would be
set to 8-N-1 (8 bits, no parity, 1 stop). Common baud rates are 2400, 9600, and 19200 bps, but it can
communicate as fast as 57,600 bps in Mode 1.

Mode 2 is an 11-bit asynchronous mode using 8 or 9-bit words and one stop bit. The time base offers a
choice of two fixed relationships of either 32 or 64 oscillator clocks per bit. It is not otherwise
programmable in speed. The 9

th

bit is selected manually. It can be set to a 1, 0, or parity. Thus Mode 2

could appear to have two stop bits by selecting the 9th bit to be a logic 1.

Mode 3 is similar to Modes 1 and 2. Like Mode 2, it uses 9-bit words instead of 8. Also like Mode 2, the
9th bit can be either 0, 1, or parity. Like Mode 1, it uses the Timer 1 mechanism to generate baud rates.
This mode can be used with a PC COM port set for 8-N-2 (8 bits, no parity, two stop bits) by setting the
9th bit to a 1. It can also support 8E1 (8 bits, even parity, one stop). Parity is done by transferring the
parity bit (PSW.0) to the 9th bit of the serial port (SCON.3). Since the CPU sets the parity bit to indicate
an odd number of bits in the accumulator, a 9-bit serial word containing this parity bit would have even
parity.

The serial port is controlled by the SCON register at SFR location 98h. The serial port begins
transmission after software writes to the SBUF register. Data is always shifted out with the LSB first.
Each mode is discussed in detail in Serial Port Control Register.

Advertising