24-10
MCF5282 User’s Manual
MOTOROLA
I
2
C Programming Examples
24.5.5 I
2
C Data I/O Register (I2DR)
In master-receive mode, reading the I2DR, shown in Figure 24-9, allows a read to occur
and initiates next byte data receiving. In slave mode, the same function is available once
the I
2
C has received its slave address.
24.6 I
2
C Programming Examples
The following examples show programming for initialization, signaling START,
post-transfer software response, signalling STOP, and generating a repeated START.
24.6.1 Initialization Sequence
Before the interface can transfer serial data, registers must be initialized, as follows:
1. Set I2FDR[IC] to obtain SCL frequency from the system bus clock. See
Section 24.5.2, “I
2
C 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.
1
IIF
I
2
C interrupt. Must be cleared by software by writing a zero to it in the interrupt routine.
0 No I
2
C interrupt pending
1 An interrupt is pending, which causes a processor interrupt request (if IIEN = 1). Set when one of the
following occurs:
• Complete one byte transfer (set at the falling edge of the ninth clock)
• Reception of a calling address that matches its own specific address in slave-receive mode
• Arbitration lost
0
RXAK Received acknowledge. The value of SDA during the acknowledge bit of a bus cycle.
0 An acknowledge signal was received after the completion of 8-bit data transmission on the bus
1 No acknowledge signal was detected at the ninth clock.
7
6
5
4
3
2
1
0
Field
Data
Reset
0000_0000
R/W
R/W
Address
0x310
Figure 24-9. I
2
C Data I/O Register (I2DR)
Table 24-5. I2SR Field Descriptions (continued)
Bits
Name
Description
Summary of Contents for ColdFire MCF5281
Page 124: ...3 20 MCF5282 User s Manual MOTOROLA EMAC Instruction Set Summary ...
Page 141: ...MOTOROLA Chapter 5 Static RAM SRAM 5 5 SRAM Programming Model ...
Page 142: ...5 6 MCF5282 User s Manual MOTOROLA SRAM Programming Model ...
Page 168: ...6 26 MCF5282 User s Manual MOTOROLA Interrupts ...
Page 186: ...7 18 MCF5282 User s Manual MOTOROLA Functional Description ...
Page 228: ...9 22 MCF5282 User s Manual MOTOROLA Functional Description ...
Page 246: ...10 18 MCF5282 User s Manual MOTOROLA Low Power Wakeup Operation ...
Page 254: ...11 8 MCF5282 User s Manual MOTOROLA Memory Map and Registers ...
Page 264: ...12 10 MCF5282 User s Manual MOTOROLA Chip Select Registers ...
Page 280: ...13 16 MCF5282 User s Manual MOTOROLA Misaligned Operands ...
Page 314: ...14 34 MCF5282 User s Manual MOTOROLA MCF5282 External Signals ...
Page 339: ...MOTOROLA Chapter 15 Synchronous DRAM Controller Module 15 25 SDRAM Example ...
Page 340: ...15 26 MCF5282 User s Manual MOTOROLA SDRAM Example ...
Page 356: ...16 16 MCF5282 User s Manual MOTOROLA DMA Controller Module Functional Description ...
Page 408: ...17 52 MCF5282 User s Manual MOTOROLA Buffer Descriptors ...
Page 446: ...20 24 MCF5282 User s Manual MOTOROLA Interrupts ...
Page 474: ...22 18 MCF5282 User s Manual MOTOROLA Programming Model ...
Page 510: ...23 36 MCF5282 User s Manual MOTOROLA Operation ...
Page 526: ...24 16 MCF5282 User s Manual MOTOROLA I2C Programming Examples ...
Page 672: ...28 12 MCF5282 User s Manual MOTOROLA Functional Description ...
Page 718: ...29 46 MCF5282 User s Manual MOTOROLA Motorola Recommended BDM Pinout ...
Page 750: ...32 8 MCF5282 User s Manual MOTOROLA Ordering Information ...