I2C Bus Interface Unit

9.4.6Master Operations

When software initiates a read or write on the I2C bus, the I2C unit transitions from the default slave-receive mode to master-transmit mode. The 7-bit slave address and the R/nW bit follow the start pulse. After the master receives an acknowledge, the I2C unit enters one of two master modes:

Master-Transmit — I2C unit writes data

Master-Receive — I2C unit reads data

The CPU writes to the ICR register to initiate a master transaction. Data is read and written from the I2C unit through the memory-mapped registers. Table 9-5describes the I2C unit’s responsibilities as a master device.

Table 9-5. Master Transactions (Sheet 1 of 2)

I2C Master

Mode of

 

 

 

Definition

Action

Operation

 

 

 

 

 

 

 

 

 

 

Generate clock

Master-transmit

• Master drives the SCL line.

• ICR[SCLE] bit must be set.

output

Master-receive

• ICR[IUE] bit must be set.

 

 

 

 

 

 

Write target

Master-transmit

CPU writes to IDBR bits 7-1 before a START condition enabled.

• First seven bits sent on bus after START.

slave address

Master-receive

to IDBR

See Section 9.3.3.

 

 

 

 

 

 

 

Master-transmit

• CPU writes to least significant IDBR bit with target slave address.

Write R/nW Bit

If low, master remains a master-transmitter. If high, master

to IDBR

Master-receive

 

transitions to a master-receiver.

 

 

See Section 9.4.2.

 

 

 

 

 

• See “Generate clock output” above.

Signal START

Master-transmit

• Performed after target slave address and R/nW bit are in IDBR.

• Software sets ICR[START] bit.

Condition

Master-receive

• Software sets ICR[TB] bit to initiate start condition.

 

 

 

 

See Section 9.3.3.

 

 

 

Initiate first

 

• CPU writes byte to IDBR

Master-transmit

I2C unit transmits byte when ICR[TB] bit is set.

data byte

Master-receive

I2C unit clears ICR[TB] bit and sets ISR[ITE] bit when transfer is

transfer

 

 

 

complete.

 

 

 

 

 

• If two or more masters signal a start within the same clock period,

 

 

 

arbitration must occur.

 

 

• I2C unit arbitrates for as long as needed. Arbitration takes place

 

 

 

during slave address and R/nW bit or data transmission and

Arbitrate for

Master-transmit

 

continues until all but one master loses the bus. No data lost.

If I

2

C unit loses arbitration, it sets ISR[ALD] bit after byte transfer is

I2C Bus

Master-receive

 

 

 

 

completed and transitions to slave-receive mode.

 

 

• If I2C unit loses arbitration as it attempts to send target address byte,

 

 

 

I2C unit attempts to resend it when the bus becomes free.

 

 

• System designer must ensure boundary conditions described in

 

 

 

Section 9.4 do not occur.

 

 

 

 

 

 

9-12

Intel® PXA255 Processor Developer’s Manual

Page 342
Image 342
Intel PXA255 manual Master Operations, Master Transactions Sheet 1, 2C Master Mode Definition Action Operation