15.11.2012 Views

LPC2131/2132/2138 User Manual - mct.net

LPC2131/2132/2138 User Manual - mct.net

LPC2131/2132/2138 User Manual - mct.net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Philips Semiconductors Preliminary <strong>User</strong> <strong>Manual</strong><br />

ARM-based Microcontroller<br />

I 2 C State Service Routines<br />

Figure 34: Forced Access to a Busy I 2 C Bus<br />

Figure 35: Recovering from a Bus Obstruction Caused by a Low Level on SDA<br />

<strong>LPC2131</strong>/<strong>2132</strong>/<strong>2138</strong><br />

This section provides examples of operations that must be performed by various I 2 C state service routines. This includes:<br />

Initialization of the I2C block after a Reset.<br />

I2C Interrupt Service<br />

The 26 state service routines providing support for all four I2C operating modes.<br />

Initialization<br />

STA flag<br />

STO flag<br />

SDA line<br />

SCL line<br />

STA flag<br />

SDA line<br />

SCL line<br />

(1)<br />

time limit<br />

1. Unsuccessful attempt to send a Start condition.<br />

2. SDA line released.<br />

3. Successful attempt to send a Start condition; state 08H is entered.<br />

In the initialization example, the I 2 C block is enabled for both master and slave modes. For each mode, a buffer is used for<br />

transmission and reception. The initialization routine performs the following functions:<br />

I2ADR is loaded with the part’s own slave address and the general call bit (GC)<br />

The I2 C interrupt enable and interrupt priority bits are set<br />

(1)<br />

Start condition<br />

(2) (3)<br />

Start condition<br />

I2C Interfaces I2C0 and I2C1 142 November 22, 2004

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!