English
Language : 

LM3S9B81 Datasheet, PDF (691/1155 Pages) Texas Instruments – Stellaris® LM3S9B81 Microcontroller
Stellaris® LM3S9B81 Microcontroller
7. 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 0x0000.0009.
8. Specify the slave address of the master and that the next operation is a Transmit by writing the
I2CMSA register with a value of 0x0000.0076. This sets the slave address to 0x3B.
9. Place data (byte) to be transmitted in the data register by writing the I2CMDR register with the
desired data.
10. Initiate a single byte transmit of the data from Master to Slave by writing the I2CMCS register
with a value of 0x0000.0007 (STOP, START, RUN).
11. Wait until the transmission completes by polling the I2CMCS register’s BUSBSY bit until it has
been cleared.
16.5
Register Map
Table 16-4 on page 691 lists the I2C registers. All addresses given are relative to the I2C base
addresses for the master and slave:
■ I2C Master 0: 0x4002.0000
■ I2C Slave 0: 0x4002.0800
■ I2C Master 1: 0x4002.1000
■ I2C Slave 1: 0x4002.1800
Note that the I2C module clock must be enabled before the registers can be programmed (see
page 174).
Table 16-4. Inter-Integrated Circuit (I2C) Interface Register Map
Offset Name
I2C Master
0x000 I2CMSA
0x004 I2CMCS
0x008 I2CMDR
0x00C I2CMTPR
0x010 I2CMIMR
0x014 I2CMRIS
0x018 I2CMMIS
0x01C I2CMICR
0x020 I2CMCR
Type
Reset
Description
R/W
0x0000.0000 I2C Master Slave Address
R/W
0x0000.0000 I2C Master Control/Status
R/W
0x0000.0000 I2C Master Data
R/W
0x0000.0001 I2C Master Timer Period
R/W
0x0000.0000 I2C Master Interrupt Mask
RO
0x0000.0000 I2C Master Raw Interrupt Status
RO
0x0000.0000 I2C Master Masked Interrupt Status
WO
0x0000.0000 I2C Master Interrupt Clear
R/W
0x0000.0000 I2C Master Configuration
See
page
693
694
699
700
701
702
703
704
705
June 29, 2010
691
Texas Instruments-Advance Information