p89c538nbb NXP Semiconductors, p89c538nbb Datasheet - Page 12

no-image

p89c538nbb

Manufacturer Part Number
p89c538nbb
Description
Cmos Single-chip 8-bit Microcontrollers With Flash Program Memory
Manufacturer
NXP Semiconductors
Datasheet
Philips Semiconductors
Serial Interface
The 89C538/536 has a standard 80C51 serial port. This serial port
can operate in 4 modes:
Mode 0: Serial data enters and exits through RxD. TxD outputs the
shift clock. 8 bits are transmitted/received (LSB first). The baud rate
is fixed at 1/12 the oscillator frequency.
Mode 1: 10 bits are transmitted (through TxD) or received (through
RxD): a start bit (0), 8 data bits (LSB first), and a stop bit (1). On
receive, the stop bit goes into RB8 in Special Function Register
SCON. The baud rate is variable.
Mode 2: 11 bits are transmitted (through TxD) or received (through
RxD): start bit (0), 8 data bits (LSB first), a programmable 9th data
bit, and a stop bit (1). On Transmit, 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. On receive, the 9th data
bit goes into RB8 in Special Function Register SCON, while the stop
bit is ignored. The baud rate is programmable to either 1/32 or 1/64
the oscillator frequency.
1998 Apr 24
NOTE:
**f
80C51 8-bit microcontroller family
16K/64K/512 FLASH
OSC
Symbol
SM0
SM1
SM2
REN
TB8
RB8
Tl
Rl
= oscillator frequency
Bit Addressable
Bit:
Function
Serial Port Mode Bit 0
Serial Port Mode Bit 1
SM0
Enables the Automatic Address Recognition feature in Modes 2 or 3. If SM2 = 1 then Rl will not be set unless the
received 9th data bit (RB8) is 1, indicating an address, and the received byte is a Given or Broadcast Address.
In Mode 1, if SM2 = 1 then Rl will not be activated unless a valid stop bit was received, and the received byte is a
Given or Broadcast Address. In Mode 0, SM2 should be 0.
Enables serial reception. Set by software to enable reception. Clear by software to disable reception.
The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software as desired.
In modes 2 and 3, the 9th data bit that was received. In Mode 1, if SM2 = 0, RB8 is the stop bit that was received.
In Mode 0, RB8 is not used.
Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or at the beginning of the stop bit in the
other modes, in any serial transmission. Must be cleared by software.
Receive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or halfway through the stop bit time in
the other modes, in any serial reception (except see SM2). Must be cleared by software.
0
0
1
1
SCON Address = 98H
SM0
7
SM1
0
1
0
1
SM1
Mode
6
0
1
2
3
Figure 5.
SM2
5
Description
shift register
8-bit UART
9-bit UART
9-bit UART
SCON: Serial Port Control Register
REN
4
Baud Rate**
f
variable
f
variable
OSC
OSC
12
TB8
/12
/64 or f
3
Mode 3: 11 bits are transmitted (through TxD) or received (through
jRxD): a start bit (0), 8 data bits (LSB first), a programmable 9th data
bit, and a stop bit (1). In fact, Mode 3 is the same as Mode 2 in all
respects except baud rate. The baud rate in Mode 3 is variable.
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.
Serial Port Control Register
The serial port control and status register is the Special Function
Register SCON, shown in Figure 5. This register contains not only
the mode selection bits, but also the 9th data bit for transmit and
receive (TB8 and RB8), and the serial port interrupt bits (TI and RI).
Additional details of serial port operation may be found in the 80C51
Family Hardware Description found in the Philips 80C51–Based
8–Bit Microcontroller Data Handbook, IC20 .
OSC
RB8
/32
2
Tl
1
Rl
0
Reset Value = 0000 0000B
89C536/89C538
Preliminary specification
SU00867

Related parts for p89c538nbb