![NXP Semiconductors freescale semiconductor ColdFire MCF51CN128 Series Скачать руководство пользователя страница 387](http://html1.mh-extra.com/html/nxp-semiconductors/freescale-semiconductor-coldfire-mcf51cn128-series/freescale-semiconductor-coldfire-mcf51cn128-series_reference-manual_1721790387.webp)
Inter-Integrated Circuit (IIC)
MCF51CN128 Reference Manual, Rev. 6
17-26
Freescale Semiconductor
17.7
Initialization/Application Information
Module Initialization (Slave)
1.
Write: IICC2
—
to enable or disable general call
—
to select 10-bit or 7-bit addressing mode
2.
Write: IICA1
—
to set the slave address
3.
Write: IICC1
—
to enable IIC and interrupts
4.
Initialize RAM variables (IICEN = 1 and IICIE = 1) for transmit data
5.
Initialize RAM variables used to achieve the routine shown in
Module Initialization (Master)
1.
Write: IICF
—
to set the IIC baud rate (example provided in this chapter)
2.
Write: IICC1
—
to enable IIC and interrupts
3.
Initialize RAM variables (IICEN = 1 and IICIE = 1) for transmit data
4.
Initialize RAM variables used to achieve the routine shown in
5.
Write: IICC1
—
to enable TX
6.
Write: IICC1
—
to enable MST (master mode)
7.
Write: IICD
—
with the address of the target slave. (The LSB of this byte determines whether the communication is master
receive or transmit.)
Module Use
can handle both master and slave IIC operations. For slave operation, an
incoming IIC message that contains the proper address begins IIC communication. For master operation,
communication must be initiated by writing to the IICD register.
0
IICF
IICA1
Baud rate = BUSCLK / (2 x MULT x (SCL DIVIDER))
TX
TXAK
RSTA
0
0
IICC1
IICEN
IICIE
MST
Module configuration
ARBL
0
SRW
IICIF
RXAK
IICS
TCF
IAAS
BUSY
Module status flags
Register Model
AD[7:1]
Address to which the module responds when addressed as a slave (in slave mode)
MULT
ICR
IICD
DATA
Data register; Write to transmit IIC data read to read IIC data
0
AD10
AD9
AD8
IICC2 GCAEN
ADEXT
Address configuration
0
0
IICSMB FACK
ALERTENSIICAEN TCKSEL SLTF
SLHF
0
0
IICA2
IIC SMBus Control and Status Register
0
SAD[7:1]