English
Language : 

EVAL-ADUC831QSZ Datasheet, PDF (57/76 Pages) Analog Devices – MicroConverter®, 12-Bit ADCs and DACs with Embedded 62 kBytes Flash MCU
ADuC831
Timer 1 Generated 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:
Modes 1 and 3 Baud Rate =
( 2SMOD/ 32 ) ×(Timer 1 Overflow Rate)
The Timer 1 interrupt should be disabled in this application. The
Timer itself can be configured for either timer or counter opera-
tion, and in any of its three running modes. In the most typical
application, it is configured for timer operation in the Autoreload
mode (high nibble of TMOD = 0010 binary). In that case, the baud
rate is given by the formula:
Modes 1 and 3 Baud Rate =
(2SMOD / 32) × (Core Clock / ( 12 × [256 – TH1]))
Table XXIV shows some commonly used baud rates and how they
might be calculated from a core clock frequency of 11.0592 MHz
and 12 MHz. Generally speaking, a 5% error is tolerable using
asynchronous (start/stop) communications.
Table XXIV. Commonly-Used Baud Rates, Timer 1
Core
Ideal CLK
Baud (MHz)
SMOD TH1-Reload Actual
Value Value
Baud
9600 12
1
19200 11.0592 1
9600 11.0592 0
2400 11.0592 0
–7 (F9H)
–3 (FDH)
–3 (FDH)
–12 (F4H)
8929
19200
9600
2400
%
Error
7
0
0
0
Timer 2 Generated Baud Rates
Baud rates can also be generated using Timer 2. Using Timer 2 is
similar to using Timer 1 in that the timer must overflow 16 times
before a bit is transmitted/received. Because Timer 2 has a 16-bit
Autoreload mode, a wider range of baud rates is possible using
Timer 2.
Modes 1 and 3 Baud Rate = ( 1/ 16 ) ×(Timer 2 Overflow Rate)
Therefore, when Timer 2 is used to generate baud rates, the timer
increments every two clock cycles and not every core machine
cycle as before. Thus, it increments six times faster than Timer 1,
and therefore baud rates six times faster are possible. Because
Timer 2 has 16-bit autoreload capability, very low baud rates are
still possible.
Timer 2 is selected as the baud rate generator by setting the TCLK
and/or RCLK in T2CON. The baud rates for transmit and receive
can be simultaneously different. Setting RCLK and/or TCLK puts
Timer 2 into its baud rate generator mode as shown in Figure 53.
In this case, the baud rate is given by the formula:
Modes 1 and 3 Baud Rate =
(Core Clk)/( 32 × [65536 – (RCAP2H, RCAP2L)])
Table XXV shows some commonly used baud rates and how they
might be calculated from a core clock frequency of 11.0592 MHz
and 12 MHz.
Table XXV. Commonly Used Baud Rates, Timer 2
Core
Ideal CLK RCAP2H RCAP2L
Baud (MHz) Value
Value
Actual %
Baud Error
19200 12
–1 (FFH) –20 (ECH) 19661 2.4
9600 12
–1 (FFH) –41 (D7H) 9591 0.1
2400 12
–1 (FFH) –164 (5CH) 2398 0.1
1200 12
–2 (FEH) –72 (B8H) 1199 0.1
19200 11.0592 –1 (FFH) –18 (EEH) 19200 0
9600 11.0592 –1 (FFH) –36 (DCH) 9600 0
2400 11.0592 –1 (FFH) –144 (70H) 2400 0
1200 11.0592 –2 (FFH) –32 (E0H) 1200 0
TIMER 1
OVERFLOW
NOTE: OSC. FREQ. IS DIVIDED BY 2, NOT 12.
CORE
2
CLK
CONTROL
C/ T2 = 0
T2
C/ T2 = 1
PIN
TR2
NOTE: AVAILABILITY OF ADDITIONAL
EXTERNAL INTERRUPT
TL2
(8 BITS)
TH2
(8 BITS)
TIMER 2
OVERFLOW
RELOAD
RCAP2L RCAP2H
2
0
1
SMOD
1
0
1
0
RCLK
16
TCLK
16
RX
CLOCK
TX
CLOCK
T2EX
PIN
TRANSITION
DETECTOR
EXF 2
TIMER 2
INTERRUPT
CONTROL
EXEN2
Figure 53. Timer 2, UART Baud Rates
REV. 0
–57–