4 mode 3, 5 sfr space, 6 baud rate generator and selection – NXP Semiconductors P89LPC9321 UM10310 User Manual

Page 60: 7 updating the brgr1 and brgr0 sfrs, Nxp semiconductors

Advertising
background image

UM10310

All information provided in this document is subject to legal disclaimers.

© NXP B.V. 2010. All rights reserved.

User manual

Rev. 2 — 1 November 2010

60 of 139

NXP Semiconductors

UM10310

P89LPC9321 User manual

10.4 Mode

3

11 bits are transmitted (through TXD) or received (through RXD): a start bit (logic 0), 8
data bits (LSB first), a programmable 9th data bit, and a stop bit (logic 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

Section 10.6

“Baud Rate generator and selection”

).

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.

10.5 SFR

space

The UART SFRs are at the following locations:

10.6 Baud Rate generator and selection

The P89LPC9321 enhanced UART has an independent Baud Rate Generator. The baud
rate is determined by a value programmed into the BRGR1 and BRGR0 SFRs. The UART
can use either Timer 1 or the baud rate generator output as determined by BRGCON[2:1]
(see

Figure 26

). Note that Timer T1 is further divided by 2 if the SMOD1 bit (PCON.7) is

set. The independent Baud Rate Generator uses CCLK.

10.7 Updating the BRGR1 and BRGR0 SFRs

The baud rate SFRs, BRGR1 and BRGR0 must only be loaded when the Baud Rate
Generator is disabled (the BRGEN bit in the BRGCON register is logic 0). This avoids the
loading of an interim value to the baud rate generator. (CAUTION: If either BRGR0 or
BRGR1 is written when BRGEN = 1, the result is unpredictable.)

Table 51.

UART SFR addresses

Register

Description

SFR location

PCON

Power Control

87H

SCON

Serial Port (UART) Control

98H

SBUF

Serial Port (UART) Data Buffer

99H

SADDR

Serial Port (UART) Address

A9H

SADEN

Serial Port (UART) Address Enable

B9H

SSTAT

Serial Port (UART) Status

BAH

BRGR1

Baud Rate Generator Rate High Byte

BFH

BRGR0

Baud Rate Generator Rate Low Byte

BEH

BRGCON

Baud Rate Generator Control

BDH

Table 52.

UART baud rate generation

SCON.7
(SM0)

SCON.6
(SM1)

PCON.7
(SMOD1)

BRGCON.1
(SBRGS)

Receive/transmit baud rate for UART

0

0

X

X

CCLK

16

0

1

0

0

CCLK

(256-TH1)64

1

0

CCLK

(256-TH1)32

X

1

CCLK

((BRGR1,BRGR0)+16)

Advertising