Replace this function in the example. Not elegant but works with
60MHz and lower.
// this function Initialises I2C
void InitialiseI2C(void)
{
REG(I2C_I2SCLL) = 0x18;
REG(I2C_I2SCLH) = 0x18;
REG(I2C_I2CONCLR) = 0xFF;
// Set pinouts as scl and sda
REG(PCB_PINSEL0) = 0x50;
REG(I2C_I2CONSET) = 0x40;
delay(10);
REG(I2C_I2CONSET) = 0x64;
REG(I2C_I2DAT) = 0x42;
REG(I2C_I2CONCLR) = 0x08;
REG(I2C_I2CONCLR) = 0x20;
}
--- In lpc2000@yahoogroups.com, "golssa" <golssa@y...> wrote:
> The Ashling code is very crude, it doesen't work when you change
the
> CPU clock frequency of the CPU to its max of 60MHz for example. It
> also does not generate I2C transactions that allow access to
multiple
> devices on the I2C bus.
>
> Since the Arm I2C peripheral is very similar to some Philips 8051
I2C
> peripherals hopefully Philips will port their 8051 IIC code
examples
> to the Arm at some point.
>
> Good peripheral software examples are unfortunately almost
completely
> lacking for this processor.
>
>
> --- In lpc2000@yahoogroups.com, "*****" <billygadget@y...> wrote:
> > Hi Bill,
> >
> > If you download the 'demo' from www.ashling.com they a have a
> > quick 'n' dirty example of I2C for thier LPC2106 demo board so
you
> > can see how its done
> >
> > regards Billy
> >
> >
> > --- In lpc2000@yahoogroups.com, "Bill Knight" <billk7670@c...>
> wrote:
> > > Does anyone have some quick-and-dirty code for testing the i2c
> > > interface on the LPC? I'm doing a hardware checkout of a PCB
> prior
> > to
> > > sending it in for second spin. All I really need is the
ability
> to
> > do
> > > a simple read and write to a single slave device. Elegant,
> > interrupt
> > > driven code will follow AFTER the PCB spin.
> > >
> > > Thanks in advance.
> > >
> > > -Bill Knight
> > > R O SoftWareMessage
Re: i2c test code
2004-03-18 by lpc2100
Attachments
- No local attachments were found for this message.