English
Language : 

LM3S611 Datasheet, PDF (321/409 Pages) List of Unclassifed Manufacturers – Microcontroller
LM3S611 Data Sheet
14.3
For example:
CLK_PRD = 50 ns
TIMER_PRD = 2
SCL_LP=6
SCL_HP=4
yields a SCL frequency of:
1/T = 333 Khz
Table 14-1 gives examples of Timer period, system clock, and speed mode (Standard or Fast).
Table 14-1. Examples of I2C Master Timer Period versus Speed Mode
System
Clock
4 Mhz
6 Mhz
12.5 Mhz
16.7 Mhz
20 Mhz
25 Mhz
33Mhz
40Mhz
50Mhz
Timer
Period
0x01
0x02
0x06
0x08
0x09
0x0C
0x10
0x13
0x18
Standard
Mode
100 Kbps
100 Kbps
89 Kbps
93 Kbps
100 Kbps
96.2 Kbps
97.1 Kbps
100 Kbps
100 Kbps
Timer
Period
-
-
0x01
0x02
0x02
0x03
0x04
0x04
0x06
Fast
Mode
-
-
312 Kbps
278 Kbps
333 Kbps
312 Kbps
330 Kbps
400 Kbps
357 Kbps
Initialization and Configuration
The following example shows how to configure the I2C module to send a single byte as a master.
This assumes the system clock is 20 MHz.
1. Enable the I2C clock by writing a value of 0x00001000 to the RCGC1 register in the System
Control module.
2. In the GPIO module, enable the appropriate pins for their alternate function using the
GPIOAFSEL register. Also, be sure to enable the same pins for Open Drain operation.
3. Initialize the I2C Master by writing the I2CMCR register with a value of 0x00000020.
4. Set the desired SCL clock speed of 100 Kbps by writing the I2CMTPR register with the correct
value. The value written to the I2CMTPR register represents the number of system clock
periods in one SCL clock period. The TPR value is determined by the following equation:
TPR = (System Clock / (2 * (SCL_LP + SCL_HP) * SCL_CLK)) - 1;
TPR = (20MHz / (2 * (6 + 4) * 100000)) - 1;
TPR = 9
Write the I2CMTPR register with the value of 0x00000009.
April 27, 2007
321
Preliminary