7 master transmitter states – NXP Semiconductors LPC24XX UM10237 User Manual

Page 605

Advertising
background image

UM10237_4

© NXP B.V. 2009. All rights reserved.

User manual

Rev. 04 — 26 August 2009

605 of 792

NXP Semiconductors

UM10237

Chapter 22: LPC24XX I

2

C interfaces I

2

C0/1/2

4. Set up Master Transmit mode data buffer.

5. Set up Master Receive mode data buffer.

6. Initialize Master data counter.

7. Exit

10.7 Master Transmitter states

10.7.1 State : 0x18

Previous state was State 8 or State 10, Slave Address + Write has been transmitted, ACK
has been received. The first data byte will be transmitted, an ACK bit will be received.

1. Load I2DAT with first data byte from Master Transmit buffer.

2. Write 0x04 to I2CONSET to set the AA bit.

3. Write 0x08 to I2CONCLR to clear the SI flag.

4. Increment Master Transmit buffer pointer.

5. Exit

10.7.2 State : 0x20

Slave Address + Write has been transmitted, NOT ACK has been received. A Stop
condition will be transmitted.

1. Write 0x14 to I2CONSET to set the STO and AA bits.

2. Write 0x08 to I2CONCLR to clear the SI flag.

3. Exit

10.7.3 State : 0x28

Data has been transmitted, ACK has been received. If the transmitted data was the last
data byte then transmit a Stop condition, otherwise transmit the next data byte.

1. Decrement the Master data counter, skip to step 5 if not the last data byte.

2. Write 0x14 to I2CONSET to set the STO and AA bits.

3. Write 0x08 to I2CONCLR to clear the SI flag.

4. Exit

5. Load I2DAT with next data byte from Master Transmit buffer.

6. Write 0x04 to I2CONSET to set the AA bit.

7. Write 0x08 to I2CONCLR to clear the SI flag.

8. Increment Master Transmit buffer pointer

9. Exit

10.7.4 State : 0x30

Data has been transmitted, NOT ACK received. A Stop condition will be transmitted.

1. Write 0x14 to I2CONSET to set the STO and AA bits.

2. Write 0x08 to I2CONCLR to clear the SI flag.

3. Exit

Advertising