MSC8144E Reference Manual, Rev. 3
24-10
Freescale
Semiconductor
I
2
C
24.4.1 Initialization Sequence
A hard reset initializes all the I
2
C registers to their default states. The following initialization
sequence initializes the I
2
C unit:
All I
2
C registers must be located in a cache-inhibited page, that is the register locations
must be defined as non-cacheable by the memory management units (MMUs).
The GPIO registers must be configured to select the I
2
C signal multiplexing options. See
Chapter 22, GPIO for details.
Update I2CFDR[FDR] and select the required division ratio to obtain the SCL frequency
from the CLASS64 clock.
Update I2CADR to define the target address for this device.
Modify I2CCR to select initiator/target mode, transmit/receive mode, and interrupt-enable
or disable.
Set the I2CCR[MEN] to enable the I
2
C interface.
24.4.2 Generation of START
After initialization, the following sequence can be used to generate START:
If the device is connected to a multi initiator I
2
C system, test the state of I2CSR[MBB] to
check whether the serial bus is free (I2CSR[MBB] = 0) before switching to initiator mode.
Select initiator mode (set I2CCR[MSTA]) to transmit serial data and select transmit mode
(set I2CCR[MTX]) for the address cycle.
Write the target address being called into the data register (I2CDR). The data written to
I2CDR[7–1] comprises the target calling address. I2CCR[MTX] indicates the direction of
transfer (transmit/receive) required from the target.
The scenario above assumes that the I
2
C interrupt bit (I2CSR[MIF]) is cleared. If
I2CSR[MIF] = 1 at any time, the I
2
C interrupt handler should immediately handle the interrupt.
24.4.3 Post-Transfer Software Response
Transmission or reception of a byte automatically sets the data transferring bit (I2CSR[MCF]),
which indicates that one byte has been transferred. The I
2
C interrupt bit (I2CSR[MIF]) is also set;
an interrupt is generated to the processor if the interrupt function is enabled during the
initialization sequence (I2CCR[MIEN] = 1). In the interrupt handler, software must do the
following:
Clear I2CSR[MIF]
Read the contents of the I
2
C data register (I2CDR) in receive mode or write to I2CDR in
transmit mode. Note that this causes I2CSR[MCF] to be cleared. See Section 24.4.10 for
details.
Summary of Contents for MSC8144E
Page 1: ...MSC8144E Reference Manual Quad Core Media Signal Processor MSC8144ERM Rev 3 July 2009 ...
Page 48: ...MSC8144E Reference Manual Rev 3 xlviii Freescale Semiconductor ...
Page 86: ...MSC8144E Reference Manual Rev 3 1 38 Freescale Semiconductor Overview ...
Page 168: ...MSC8144E Reference Manual Rev 3 3 60 Freescale Semiconductor External Signals ...
Page 242: ...MSC8144E Reference Manual Rev 3 5 26 Freescale Semiconductor Reset ...
Page 314: ...MSC8144E Reference Manual Rev 3 8 24 Freescale Semiconductor General Configuration Registers ...
Page 414: ...MSC8144E Reference Manual Rev 3 10 14 Freescale Semiconductor MSC8144E SC3400 DSP Subsystem ...
Page 452: ...MSC8144E Reference Manual Rev 3 11 38 Freescale Semiconductor Internal Memory Subsystem ...
Page 520: ...MSC8144E Reference Manual Rev 3 12 68 Freescale Semiconductor DDR SDRAM Memory Controller ...
Page 1070: ...MSC8144E Reference Manual Rev 3 21 28 Freescale Semiconductor Timers ...