UM10413
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2011. All rights reserved.
User manual
Rev. 1 — 16 December 2011
145 of 268
NXP Semiconductors
UM10413
MPT612 User manual
3. Write 0x20 to I2CONSET to set bit STA.
4. Set up the master receive buffer.
5. Initialize the master data counter to match the length of the message to be received.
6. Exit.
16.9.4 I
2
C interrupt routine
Determine the I
2
C state and which state routine will be used to handle it.
1. Read the I
2
C status from I2STA.
2. Use the status value to branch to one of 26 possible state routines.
16.9.5 Non mode-specific states
16.9.5.1
State: 0x00
Bus error. Enter not-addressed slave mode and release bus.
1. Write 0x14 to I2CONSET to set the STO and AA bits.
2. Write 0x08 to I2CONCLR to clear the SI flag.
3. Exit.
16.9.5.2
Master states
State 08 and state 10 are for both master transmit and master receive modes. Bit R/W
decides whether the next state is within master transmit mode or master receive mode.
16.9.5.3
State: 0x08
A Start condition is transmitted. The slave a bit R/W is transmitted, an ACK bit is
received.
1. Write slave address with bit R/W to I2DAT.
2. Write 0x04 to I2CONSET to set bit AA.
3. Write 0x08 to I2CONCLR to clear the SI flag.
4. Set up master transmit mode data buffer.
5. Set up master receive mode data buffer.
6. Initialize master data counter.
7. Exit.
16.9.5.4
State: 0x10
A repeated Start condition is transmitted. The slave a bit R/W is transmitted, an
ACK bit is received.
1. Write slave address with bit R/W to I2DAT.
2. Write 0x04 to I2CONSET to set bit AA.
3. Write 0x08 to I2CONCLR to clear the SI flag.
4. Set up master transmit mode data buffer.
5. Set up master receive mode data buffer.
6. Initialize master data counter.