
Register Description and Programming
MOTOROLA
UART Modules
15-29
15.4.2
PROGRAMMING
Figure 11-9 shows the basic interface software flowchart required for operation of the UART module. The
routines are divided into these three categories:
1. UART Module Initialization
2. I/O Driver
3. Interrupt Handling
15.4.2.1
UART Module Initialization
The UART module initialization routines consist of SINIT and CHCHK. SINIT is called at system
initialization time to check UART operation. Before SINIT is called, the calling routine allocates two words
on the system stack. On return to the calling routine, SINIT passes information on the system stack to
reflect the status of the UART. If SINIT finds no errors, the receiver and transmitter are enabled. The
CHCHK routine performs the actual checks as called from the SINIT routine. When called, SINIT places
the UART in the local loopback mode and checks for the following errors:
Transmitter Never Ready
Receiver Never Ready
Parity Error
Incorrect Character Received
15.4.2.2
I/O Driver Example
The I/O driver routines consist of INCH and OUTCH. INCH is the terminal input character routine and
obtains a character from the receiver. OUTCH sends a character to the transmitter.
15.4.2.3
Interrupt Handling
The interrupt-handling routine consists of SIRQ, which is executed after the UART module generates an
interrupt caused by a change in break (beginning of a break). SIRQ then clears the interrupt source, waits
Table 15-33 Output Port Data Bit Descriptions
BIT NAME
DESCRIPTION
RTS
Output Port Parallel Output
1 = A write cycle to the OPset address asserts the RTS signal.
0 = This bit is not affected by writing a zero to this address.
The output port bits are inverted at the pins so the RTS set bit provides an asserted RTS pin.
Table 15-34 Output Port Data Registers (UOP0n)
BITS
7
6
5
4
3
2
1
0
FIELD
—
——
RTS
RESET
—
——
—
R/W
WRITE ONLY
ADDR
MBAR + $1FC (UOP00)
MBAR + $23C (UOP01)
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.