![Freescale Semiconductor MCF54455 Reference Manual Download Page 838](http://html1.mh-extra.com/html/freescale-semiconductor/mcf54455/mcf54455_reference-manual_2330541838.webp)
I
2
C Interface
Freescale Semiconductor
33-12
33.3.8
Handshaking and Clock Stretching
The clock synchronization mechanism can acts as a handshake in data transfers. Slave devices can hold
I2C_SCL low after completing one byte transfer. In such a case, the clock mechanism halts the bus clock
and forces the master clock into wait states until the slave releases I2C_SCL.
Slaves may also slow down the transfer bit rate. After the master has driven I2C_SCL low, the slave can
drive I2C_SCL low for the required period and then release it. If the slave I2C_SCL low period is longer
than the master I2C_SCL low period, the resulting I2C_SCL bus signal low period is stretched.
33.4
Initialization/Application Information
The following examples show programming for initialization, signaling START, post-transfer software
response, signaling STOP, and generating a repeated START.
33.4.1
Initialization Sequence
Before the interface can transfer serial data, registers must be initialized:
1. Set I2FDR[IC] to obtain I2C_SCL frequency from the system bus clock. See
Frequency Divider Register (I2FDR).”
2. Update the I2ADR to define its slave address.
3. Set I2CR[IEN] to enable the I
2
C bus interface system.
4. Modify the I2CR to select or deselect master/slave mode, transmit/receive mode, and
interrupt-enable or not.
NOTE
If I2SR[IBB] is set when the I
2
C bus module is enabled, execute the
following pseudocode sequence before proceeding with normal
initialization code. This issues a STOP command to the slave device,
placing it in idle state as if it were power-cycled on.
I2CR = 0x0
I2CR = 0xA0
dummy read of I2DR
I2SR = 0x0
I2CR = 0x0
I2CR = 0x80
; re-enable
33.4.2
Generation of START
After completion of the initialization procedure, serial data can be transmitted by selecting the master
transmitter mode. On a multiple-master bus system, I2SR[IBB] must be tested to determine whether the
serial bus is free. If the bus is free (IBB is cleared), the START signal and the first byte (the slave address)
can be sent. The data written to the data register comprises the address of the desired slave and the lsb
indicates the transfer direction.
The free time between a STOP and the next START condition is built into the hardware that generates the
START cycle. Depending on the relative frequencies of the system clock and the I2C_SCL period, the
Summary of Contents for MCF54455
Page 33: ...xxviii Freescale Semiconductor ...
Page 67: ...Freescale Semiconductor 1 ...
Page 125: ...Freescale Semiconductor 1 ...
Page 145: ...Enhanced Multiply Accumulate Unit EMAC 5 21 Freescale Semiconductor ...
Page 173: ...Cache 6 28 Freescale Semiconductor ...
Page 179: ...Static RAM SRAM 7 6 Freescale Semiconductor ...
Page 207: ...Power Management 9 16 Freescale Semiconductor ...
Page 323: ...Reset Controller Module 13 8 Freescale Semiconductor ...
Page 389: ...Pin Multiplexing and Control 16 44 Freescale Semiconductor ...
Page 575: ...PCI Bus Controller 22 58 Freescale Semiconductor ...
Page 600: ...Advanced Technology Attachment ATA Freescale Semiconductor 23 25 ...
Page 601: ...Freescale Semiconductor 1 ...
Page 842: ...I2 C Interface Freescale Semiconductor 33 16 ...
Page 843: ...Freescale Semiconductor 1 ...
Page 921: ...Revision History A 6 Freescale Semiconductor ...