English
Language : 

AT32UC3L064_2 Datasheet, PDF (477/830 Pages) ATMEL Corporation – 32-bit AVR® Microcontroller
AT32UC3L016/32/64
22.8.2.1
Clock Generation
The Clock Waveform Generator Register (CWGR) is used to control the waveform of the
TWCK clock. CWGR must be programmed so that the desired TWI bus timings are generated.
CWGR describes bus timings as a function of cycles of a prescaled clock. The clock prescal-
ing can be selected through the EXP field in CWGR.
fprescaled = 2----(--E-f--cX--l-P-k--p-+--b--1---)--)
CWGR has the following fields:
LOW: Prescaled clock cycles in clock low count. Used to time TLOW. and TBUF.
HIGH: Prescaled clock cycles in clock high count. Used to time THIGH.
STASTO: Prescaled clock cycles in clock high count. Used to time THD_STA, TSU_STA, TSU_STO.
DATA: Prescaled clock cycles for data setup and hold count. Used to time THD_DAT, TSU_DAT.
EXP: Specifies the clock prescaler setting.
Note that the total clock low time generated is the sum of THD_DAT + TSU_DAT + TLOW.
Any slave or other bus master taking part in the transfer may extend the TWCK low period at
any time.
The TWIM hardware monitors the state of the TWCK line as required by the I²C specification.
The clock generation counters are started when a high/low level is detected on the TWCK line,
not when the TWIM hardware releases/drives the TWCK line. This means that the CWGR set-
tings alone do not determine the TWCK frequency. The CWGR settings determine the clock
low time and the clock high time, but the TWCK rise and fall times are determined by the exter-
nal circuitry (capacitive load, etc.).
Figure 22-5. Bus Timing Diagram
t LOW
t HIGH
t LOW
S
t HD:STA
t
SU:DAT
t HD:DAT
t SU:DAT
t
SU:STO
P
t SU:STA
Sr
22.8.2.2
Setting up and Performing a Transfer
Operation of TWIM is mainly controlled by the Control Register (CR) and the Command Reg-
ister (CMDR). The following list presents the main steps in a typical communication:
32099D–06/2010
477