UM10147_2
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 02 — 28 April 2008
59 of 134
NXP Semiconductors
UM10147
P89LPC952/954 User manual
10.8 Framing error
A Framing error occurs when the stop bit is sensed as a logic 0. A Framing error is
reported in the status register (SnSTAT). In addition, if SMOD0 (PCON.6) is 1, framing
errors can be made available in SnCON.7. If SMOD0 is 0, S0CON.7 is SM0_0
and
S1CON is SM0_1. It is recommended that SM0_n and SM1_n (SnCON[7:6]) are
programmed when SMOD0 is logic 0.
10.9 Break detect
A break detect is reported in the status register (SnSTAT). A break is detected when any
11 consecutive bits are sensed low. Since a break condition also satisfies the
requirements for a framing error, a break condition will also result in reporting a framing
error. Once a break condition has been detected, the UART will go into an idle state and
remain in this idle state until a stop bit has been received. The break detect of UART0 can
be used to reset the device and force the device into ISP mode by setting the EBRR bit
(AUXR1.6). The break detect of UART1 cannot reset the device but can be used to
generate an interrupt.
Fig 21. Baud rate generation for UARTs (Modes 1, 3).
baud rate modes 1 and 3
SBRGS = 1
SBRGS = 0
SMOD1 = 0
SMOD1 = 1
timer 1 overflow
(PCLK-based)
baud rate generator
(CCLK-based)
002aaa897
÷
2
Table 50.
Serial Port 0 Control register (S0CON - address 98h) bit allocation
Bit
7
6
5
4
3
2
1
0
Symbol
SM0_0/F
E_0
SM1_0
SM2_0
REN_0
TB8_0
RB8_0
TI_0
RI_0
Reset
x
x
x
x
x
x
0
0
Table 51.
Serial Port 0 Control register (S0CON - address 98h) bit description
Bit Symbol
Description
0
RI_0
Receive interrupt flag 0. Set by hardware at the end of the 8th bit time in Mode 0,
or approximately halfway through the stop bit time in Mode 1. For Mode 2 or Mode
3, if SMOD0, it is set near the middle of the 9th data bit (bit 8). If SMOD0 = 1, it is
set near the middle of the stop bit (see SM2_0 - S0CON.5 - for exceptions). Must
be cleared by software.
1
TI_0
Transmit interrupt flag 0. Set by hardware at the end of the 8th bit time in Mode 0,
or at the stop bit (see description of INTLO_0 bit in S0STAT register) in the other
modes. Must be cleared by software.
2
RB8_0
The 9th data bit that was received in Modes 2 and 3. In Mode 1 (SM2 must be 0),
RB8_0 is the stop bit that was received. In Mode 0, RB_0 is undefined.
3
TB8_0
The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software
as desired.
4
REN_0
Enables serial reception. Set by software to enable reception. Clear by software to
disable reception.