EasyManuals Logo

Holtek HT48R30A-1 User Manual

Default Icon
174 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #82 background imageLoading...
Page #82 background image
by the UART. Clearing the TXEN bit during a transmission will cause the transmission to be
aborted and will reset the transmitter. If this occurs, the TX pin can be used as a general purpose
I/O pin.
Baud Rate Generator
To setup the speed of the serial data communication, the UART function contains its own dedi
-
cated 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 register. 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 for
-
mula. Note that N is the decimal value placed in the BRG register and has a range of between 0
and 255.
UCR2 BRGH Bit 0 1
Baud Rate
f
[64 (N+1)]
SYS
f
[16 (N+1)]
SYS
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 ac
-
tual baud rate is determined using a discrete value, N, placed in the BRG register, there will be an
error associated between 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 ²0², determine the BRG register value N, the
actual baud rate and the error value for a desired baud rate of 9600.
From the above table the desired baud rate BR =
f
[64 (N+1)]
SYS
Re-arranging this equation gives N =
f
(BRx64)
SYS
- 1
Giving a value for N =
8000000
9600 64()x
- 1 = 12.0208
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 =
8000000
[64(12+1)]
= 9615
Therefore the error is equal to = 0.16%
Chapter 1 Hardware Structure
73
9 6 1 5
-
9 6 0 0
9 6 0 0

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Holtek HT48R30A-1 and is the answer not in the manual?

Holtek HT48R30A-1 Specifications

General IconGeneral
BrandHoltek
ModelHT48R30A-1
CategoryMicrocontrollers
LanguageEnglish

Related product manuals