I 2 C Interrupt Routine; Non Mode Specific States; State: 0X00; Master States - Philips LPC2101 User Manual

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
2
11.9.4 I
Determine the I

11.9.5 Non mode specific states

11.9.5.1 State: 0x00

Bus Error. Enter not addressed Slave mode and release bus.

11.9.5.2 Master States

State 08 and State 10 are for both Master Transmit and Master Receive modes. The R/W
bit decides whether the next state is within Master Transmit mode or Master Receive
mode.

11.9.5.3 State: 0x08

A Start condition has been transmitted. The Slave Address + R/W bit will be transmitted,
an ACK bit will be received.

11.9.5.4 State: 0x10

A repeated Start condition has been transmitted. The Slave Address + R/W bit will be
transmitted, an ACK bit will be received.

User manual

1. Initialize Master data counter.
2. Set up the Slave Address to which data will be transmitted, and add the Read bit.
3. Write 0x20 to I2CONSET to set the STA bit.
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
C interrupt routine
2
C state and which state routine will be used to handle it.
2
1. Read the I
C status from I2STA.
2. Use the status value to branch to one of 26 possible state routines.
1. Write 0x14 to I2CONSET to set the STO and AA bits.
2. Write 0x08 to I2CONCLR to clear the SI flag.
3. Exit
1. Write Slave Address with R/W bit to I2DAT.
2. Write 0x04 to I2CONSET to set the AA bit.
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
1. Write Slave Address with R/W bit to I2DAT.
2. Write 0x04 to I2CONSET to set the AA bit.
3. Write 0x08 to I2CONCLR to clear the SI flag.
Rev. 01 — 12 January 2006
UM10161
2
Chapter 11: I
C interfaces
© Koninklijke Philips Electronics N.V. 2006. All rights reserved.
150

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2103Lpc2102

Table of Contents