Philips P89LPC902 Light Therapy Device User Manual


 
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
UART (P89LPC903)
2003 Dec 8 61
8. UART (P89LPC903)
The P89LPC903 has an enhanced UART that is compatible with the conventional 80C51 UART except that Timer 2 overflow
cannot be used as a baud rate source. The P89LPC903 does include an independent Baud Rate Generator. The baud rate can
be selected from the oscillator (divided by a constant), Timer 1 overflow, or the independent Baud Rate Generator. In addition to
the baud rate generation, enhancements over the standard 80C51 UART include Framing Error detection, break detect,
automatic address recognition, selectable double buffering and several interrupt options.
The UART can be operated in 4 modes:
Mode 0
Serial data enters and exits through RxD. TxD outputs the shift clock. 8 bits are transmitted or received, LSB first. The baud rate
is fixed at 1/16 of the CPU clock frequency.
Mode 1
10 bits are transmitted (through TxD) or received (through RxD): a start bit (logical 0), 8 data bits (LSB first), and a stop bit (logical
1). When data is received, the stop bit is stored in RB8 in Special Function Register SCON. The baud rate is variable and is
determined by the Timer 1 overflow rate or the Baud Rate Generator (see "Baud Rate Generator and Selection" section).
Mode 2
11 bits are transmitted (through TxD) or received (through RxD): start bit (logical 0), 8 data bits (LSB first), a programmable 9th
data bit, and a stop bit (logical 1). When data is transmitted, the 9th data bit (TB8 in SCON) can be assigned the value of 0 or 1.
Or, for example, the parity bit (P, in the PSW) could be moved into TB8. When data is received, the 9th data bit goes into RB8
in Special Function Register SCON and the stop bit is not saved. The baud rate is programmable to either 1/16 or 1/32 of the
CCLK frequency, as determined by the SMOD1 bit in PCON.
Mode 3
11 bits are transmitted (through TxD) or received (through RxD): a start bit (logical 0), 8 data bits (LSB first), a programmable 9th
data bit, and a stop bit (logical 1). Mode 3 is the same as Mode 2 in all respects except baud rate. The baud rate in Mode 3 is
variable and is determined by the Timer 1 overflow rate or the Baud Rate Generator (see "Baud Rate Generator and Selection"
section).
In all four modes, transmission is initiated by any instruction that uses SBUF as a destination register. Reception is initiated in
Mode 0 by the condition RI = 0 and REN = 1. Reception is initiated in the other modes by the incoming start bit if REN = 1.