Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

I2c problem in lpc2124

I2c problem in lpc2124

2006-04-22 by Gopalakrishnan

Hi
I am trying to interface a DS1307 RTC to LPC2124.
The pclk  is 60MHZ with VPIB divider being 1.
This is how i initialised the I2C
void i2cInit(void)
{
	unsigned int i;
	// setup SCL pin P02
	PINSEL0 &= ~(3<<4);
	PINSEL0 |=   1<<4;
	// setup SDA pin P03
	PINSEL0 &= ~(3<<6);
	PINSEL0 |=   1<<6;

	// set default bitrate of 100KHz
	I2SCLL = 400;
	I2SCLH = 400;


	// disable and reset interface
	I2CONCLR = 0xFF;
	
	for(i=0;i<5000;i++);
	// enable interface
	I2CONSET |= 1<<I2CON_I2EN;
}
Now problem is after i send  start the i2cstat is not giving 08h
value.It just hangs means the I2CSTAT remains 0xF8.All physical
connections are proper which i checked.Can somebody help me to debug this.
Regards
Gopalakrishnan.N

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.