I²C example for LPC2148?

I’m looking for a simple sample that demonstrates how to use I²C on the Olimex LPC2148 board.

Also could anyone please explain the meaning of these ‘variables’:

I20CONSET

I20STAT

I20DAT

I20ADR

I20SCLH

I20SCLL

I20CONCLR

Does the controller detect the start conditions? I would like to install an interrupt handler which gets called as soon as a byte has been received.

I’m using Eclipse + gnuarm.

Thanks Andre

What do you want to use the I2C for Master, Slave, Multi Matser ?

There are examples from Philips for Master Operation. I also have Slave operation working.

Read the examples in the first instance.

Try this page first http://www.siwawi.arubi.uni-kl.de/avr_p … index.html

Good Luck!

fordp:
What do you want to use the I2C for Master, Slave, Multi Master ?

Both, the LPC is going between the current master and slave.

Master → LPC Slave [Serial connection with PC to talk to Master] LPC Master → Slave

In the first step I would like to talk to the master so the LPC works as a slave.

I’m also not sure if they use a valid communication because it looks like a 10-bit address, where the address indicates wheter to read or to write, also I don’t understand how to detect the start of the data.

I also have an other question, can the slave initiate the communication to pull data from the master or does the master always send a packet “do you want to read data from me” and if the slave has to set the ACK?

http://andre.honda-tech.de/lpc/sbi.png

Can I connect the master directly to SDA0 and SCL0 or do I have to add pull-up resistors?

By definition Slaves only Respond and do not insigate communication.

Yes you need pull up resistors.

You should also do some reading on i2c communication rather than posting questions that can be answered easily with some background reading.

Fire up google in your browser and get reading.

Good Luck.