EasyManua.ls Logo

Atmel 8051 - Page 97

Atmel 8051
113 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
Loading...
Common Features Description
Atmel 8051 Microcontrollers Hardware Manual 2-96
4316B–8051–02/04
2.13.4 Using Timer 1 to
Generate Baud
Rates
When Timer 1 is used as the baud rate generator, the baud rates in Modes 1 and 3 are
determined by the Timer 1 overflow rate and the value of SMOD as follows:
The Timer 1 interrupt should be disabled in this application. The Timer itself can be con-
figured for either “timer” or “counter” operation, and in any of its 3 running modes. In the
most typical applications, it is configured for “timer” operation, in the auto-reload mode
(high nibble of TMOD = 0010B). In that case, the baud rate is given by the formula
One can achieve very low baud rates with Timer 1 by leaving the Timer 1 interrupt
enabled, and configuring the Timer to run as a 16-bit timer (high nibble of TMOD =
0001B), and using the Timer 1 interrupt to do a 16-bit software reload.
Figure 2-21 lists various commonly used baud rates and how they can be obtained from
Timer 1.
Figure 2-21. Timer 1 Generated Commonly Used Baud Rates
2.13.5 Using Timer 2 to
Generate Baud
Rates
Timer 2 is selected as the baud rate generator by setting TCLK and/or RCLK in T2CON
(Table 2-8). Note then the baud rates for transmit and receive can be simultaneously dif-
ferent. Setting RCLK and/or TCLK puts Timer 2 into its baud rate generator mode, as
shown in Figure 2-22.
Fosc (MHz) 11.0592 12 14.7456 16 20 SMOD
Baudrate
150 40h 30h 00h 0
300 A0h 98h 80h 75h 52h 0
600 D0h CCh C0h BBh A9h 0
1200 E8h E6h E0h DEh D5h 0
2400 F4h F3h F0h EFh EAh 0
4800 F3h EFh EFh 1
4800 FAh F8h F5h 0
9600 FDh FCh 0
9600 F5h 1
19200 FDh FCh 1
38400 FEh
76800 FFh

Related product manuals