
EZ-USB FX2 Technical Reference Manual
Page 14-20 EZ-USB FX2 Technical Reference Manual v2.1
14.3.4 Mode 1
Mode 1 provides standard asynchronous, full-duplex communication, using a total of 10 bits: 1
start bit, 8 data bits, and 1 stop bit. For receive operations, the stop bit is stored in RB8_0 (or
RB8_1). Data bits are received and transmitted LSB first.
Mode 1 operation is identical to that of the standard 8051 when Timer 1 uses CLKOUT/12,
(T1M=0, the default).
14.3.4.1 Mode 1 Baud Rate
The mode 1 baud rate is a function of timer overflow. Serial Port 0 can use either Timer 1 or Timer
2 to generate baud rates. Serial Port 1 can only use Timer 1. The two serial ports can run at the
same baud rate if they both use Timer 1, or different baud rates if Serial Port 0 uses Timer 2 and
Serial Port 1 uses Timer 1.
Each time the timer increments from its maximum count (0xFF for Timer 1 or 0xFFFF for Timer 2),
a clock is sent to the baud rate circuit. That clock is then divided by 16 to generate the baud rate.
When using Timer 1, the SMOD0 (or SMOD1) Bit selects whether or not to divide the Timer 1 roll-
over rate by 2. Therefore, when using Timer 1, the baud rate is determined by the equation:
When using Timer 2, the baud rate is determined by the equation:
To use Timer 1 as the baud rate generator, it is generally best to use Timer 1 mode 2 (8-bit counter
with auto-reload), although any counter mode can be used. In mode 2, the Timer 1 reload value is
stored in the TH1 register, which makes the complete formula for Timer 1:
To derive the required TH1 value from a known baud rate when T1M=0, use the equation:
× Timer 1 OverflowBaud Rate =
32
2
SMODx
Timer 2 Overflow
Baud Rate =
16
×Baud Rate =
32
2
SMODx
(12 - 8 × T1M) × (256 - TH1)
CLKOUT
×
TH1 =
2
SMODx
CLKOUT
384 × Baud Rate
256 -
Kommentare zu diesen Handbüchern