71M6403
Electronic Trip Unit
SEPTEMBER 2006
Page: 21 of 75
©
2006 TERIDIAN Semiconductor Corporation
REV 1.0
UART
The 71M6403 includes a UART (UART0) that can be programmed for general purpose communications. A second UART
(UART1) is connected to the optical port, as described in the optical port description.
The UART is a dedicated 2-wire serial interface, which can communicate with an external host processor at up to 38,400 bits/s
(with MPU clock = 1.2288MHz). The operation of each pin is as follows:
RX
: Serial input data are applied at this pin. Conforming to RS-232 standard, the bytes are input LSB first. The voltage applied at
RX must not exceed 3.6V.
TX
: This pin is used to output the serial data. The bytes are output LSB first.
The 71M6403 has several UART-related registers, which can be read and written. All UART transfers are programmable for
parity enable, parity, 2 stop bits/1 stop bit and XON/XOFF options for variable communication baud rates from 300 to 38400 bps.
Table 11 shows how the baud rates are calculated. Table 12 shows the selectable UART operation modes.
Using Timer 1
Using Internal Baud Rate Generator
Serial Interface 0
2
smod
* f
CKMPU
/ (384 * (256-TH1))
2
smod
* f
CKMPU
/(64 * (2
10
-S0REL))
Serial Interface 1
N/A f
CKMPU
/(32 * (2
10
-S1REL))
Note:
S0REL and S1REL are 10-bit values derived by combining bits from the respective timer reload registers. SMOD is the
SMOD bit in the SFR
PCON
. TH1 is the high byte of timer 1.
Table 11: Baud Rate Generation
UART 0
UART 1
Mode 0
N/A
Start bit, 8 data bits, parity, stop bit, variable
baud rate (internal baud rate generator)
Mode 1
Start bit, 8 data bits, stop bit,
variable baud rate (internal baud
rate generator or timer 1)
Start bit, 8 data bits, stop bit, variable baud rate
(internal baud rate generator)
Mode 2
Start bit, 8 data bits, parity, stop bit,
fixed baud rate 1/32 or 1/64 of f
CKMPU
N/A
Mode 3
Start bit, 8 data bits, parity, stop bit,
variable baud rate (internal baud
rate generator or timer 1)
N/A
Table 12: UART Modes
Note: Parity of serial data is available through the P flag of the accumulator. Seven-bit serial modes with parity, such as those
used by the FLAG protocol, can be simulated by setting and reading bit 7 of 8-bit output data. Seven-bit serial modes without
parity can be simulated by setting bit 7 to a constant 1. 8-bit serial modes with parity can be simulated by setting and reading the
9
th
bit, using the control bits S0CON3 and S1CON3 in the S0COn and S1CON SFRs.
electronic components distributor