HT48CU80 Holtek Semiconductor, HT48CU80 Datasheet - Page 26

no-image

HT48CU80

Manufacturer Part Number
HT48CU80
Description
(HT48RU80 / HT48CU80) I/O Type 8-Bit MCU
Manufacturer
Holtek Semiconductor
Datasheet
www.DataSheet4U.com
Rev. 1.00
RIE
This bit enables or disables the receiver interrupt. If
this bit is equal to 1 when the receiver overrun
OERR flag or receive data available RXIF flag is
set, the UART interrupt request flag will be set. If
this bit is equal to 0 the UART interrupt will not be
influenced by the condition of the OERR or RXIF
flags.
WAKE
This bit enables or disables the receiver wake-up
function. If this bit is equal to 1 and if the MCU is in
the Power Down Mode, a low going edge on the RX
input pin will wake-up the device. If this bit is equal
to 0 and if the MCU is in the Power Down Mode,
any edge transitions on the RX pin will not wake-up
the device.
ADDEN
The ADDEN bit is the address detect mode bit.
When this bit is 1 the address detect mode is en-
abled. When this occurs, if the 8th bit, which corre-
sponds to RX7 if BNO=0, or the 9th bit, which
corresponds to RX8 if BNO=1, has a value of 1
then the received word will be identified as an ad-
dress, rather than data. If the corresponding inter-
rupt is enabled, an interrupt request will be
generated each time the received word has the ad-
dress bit set, which is the 8 or 9 bit depending on the
value of BNO. If the address bit is 0 an interrupt
will not be generated, and the received data will be
discarded.
BRGH
The BRGH bit selects the high or low speed mode
of the Baud Rate Generator. This bit, together with
the value placed in the BRG register, controls the
Baud Rate of the UART. If this bit is equal to 1 the
high speed mode is selected. If the bit is equal to 0
the low speed mode is selected.
RXEN
The RXEN bit is the Receiver Enable Bit. When this
bit is equal to 0 the receiver will be disabled with
any pending data receptions being aborted. In addi-
tion the buffer will be reset. In this situation the RX
pin can be used as a general purpose I/O pin. If the
RXEN bit is equal to 1 the receiver will be enabled
and if the UARTEN bit is equal to 1 the RX pin will
be controlled by the UART. Clearing the RXEN bit
during a transmission will cause the data reception
to be aborted and will reset the receiver. If this oc-
curs, the RX pin can be used as a general purpose
I/O pin.
TXEN
The TXEN bit is the Transmitter Enable Bit. When
this bit is equal to 0 the transmitter will be disabled
with any pending transmissions being aborted. In
addition the buffer will be reset. In this situation the
TX pin can be used as a general purpose I/O pin. If
the TXEN bit is equal to 1 the transmitter will be
enabled and if the UARTEN bit is equal to 1 the
26
Baud rate generator
To setup the speed of the serial data communication,
the UART function contains its own dedicated baud
rate generator. The baud rate is controlled by its own
internal free running 8-bit timer, the period of which is
determined by two factors. The first of these is the
value placed in the BRG register and the second is the
value of the BRGH bit within the UCR2 control regis-
ter. The BRGH bit decides, if the baud rate generator
is to be used in a high speed mode or low speed
mode, which in turn determines the formula that is
used to calculate the baud rate. The value in the BRG
register determines the division factor, N, which is
used in the following baud rate calculation formula.
Note that N is the decimal value placed in the BRG
register and has a range of between 0 and 255.
By programming the BRGH bit which allows selection
of the related formula and programming the required
value in the BRG register, the required baud rate can
be setup. Note that because the actual baud rate is
determined using a discrete value, N, placed in the
BRG register, there will be an error associated be-
tween the actual and requested value. The following
example shows how the BRG register value N and the
error value can be calculated.
Calculating the register and error values
For a clock frequency of 8MHz, and with BRGH set to
baud rate and the error value for a desired baud rate
of 9600.
From the above table the desired baud rate BR
Re-arranging this equation gives N
Giving a value for N
To obtain the closest value, a decimal value of 12
should be placed into the BRG register. This gives an
actual or calculated baud rate value of
BR
Therefore the error is equal to
0 determine the BRG register value N, the actual
Baud Rate
UCR2 BRGH Bit
TX pin will be controlled by the UART. Clearing the
TXEN bit during a transmission will cause the trans-
mission to be aborted and will reset the transmitter.
If this occurs, the TX pin can be used as a general
purpose I/O pin.
[64 (N + 1)]
f
[64(12 + 1)]
SYS
8000000
HT48RU80/HT48CU80
9615
(
8000000
9600 64
[64 (N + 1)]
f
SYS
0
x
)
1
(BRx64)
April 12, 2006
[16 (N + 1)]
12.0208
f
SYS
f
= 0.16%
SYS
1
1

Related parts for HT48CU80