User`s guide

UARTs LZ87010 Advance User’s Guide
10-12 1/15/03
Table 10-5. SCON and SCON1 Register Bits
BIT NAME DESCRIPTION
7SM[0]Serial Mode Determines the operating mode of the UART. See Table 10-6.
6SM[1]Serial Mode Determines the operating mode of the UART. See Table 10-6.
5SM[2]
Serial Mode In Mode 0, this bit must be ‘0’. In other modes, this bit, if ‘1’, will
suppress the Receive Data Interrupt if the data is not valid. The definition of ‘valid’
depends on the mode, as described below. If ‘0’, the Receive Data Interrupt func-
tions normally.
In Mode 1, this bit, if ‘1’, will cause the receive data interrupt to be suppressed if
a valid stop bit was not received. In Modes 2 and 3, this bit, if ‘1’, enables the ‘mul-
tiprocessor communication’ feature, where the receive data interrupt is sup-
pressed if the ninth data bit (RB8) is ‘0’. This feature is intended to allow multiple
receiving units on a single serial line. Characters with the ninth data bit (RB8) set
to ‘1’ are broadcast characters received by all listeners.
4REN
Receive Enable
1 = The receive data channel of the UART is enabled.
0 = The receive data channel of the UART is disabled.
3TB8Transmit Data Bit[8] In Modes 2 and 3, this is the ninth bit transmitted.
2RB8
Receive Data Bit[8] In Modes 2 and 3, this is the ninth bit received. In Mode 1,
if SM[0:1] = 0 this is the stop bit received. In Mode 0, this bit is not used.
1TI
Transmit Interrupt Flag Set by hardware at the end of the eighth bit in Mode 0
or at the beginning of the stop bit in other modes. Must be cleared by software.
Setting this bit in software will generate an interrupt.
0RI
Receive Interrupt Flag Set by hardware at the end of the eighth bit in Mode 0
or halfway through the stop bit in other modes. If at that point the RI bit is already
set, the received data will be discarded: RI, RB8, and SBUF will not be updated.
Must be cleared by software. Setting this bit in software will generate an interrupt.
Table 10-6. SM[0:1] UART 0 and UART 1 Mode Bits
SM[0] SM[1] MODE BAUD RATE
000
Baud rate is PCLK. For example, if PCLK is 10 MHz, the baud rate is
10 Mbit/s.
011
UART 0: The baud rate is determined by the SMOD bit in the PCON
register and by Timer 1:
Baud Rate = (PCON.SMOD + 1) × PCLK ÷ (32 × (256 – TH1)).
Timer 1 is set up to run in auto-reload mode (Timer Mode 2).
UART 1: The baud rate is determined by the baud rate generator’s
16-bit counter value:
Baud Rate = PCLK ÷ ((BRGCNTH,BRGCNTL + 1) × 16).
1 0 2 The baud rate is PCLK/64.
1 1 3 Same as Mode 1.