I have a problem with i2c slave because I not have the correct inizialize procedure.
I have used this procedure:
_BOOL init_i2c_0(void)
{
I2CSlaveState = I2C_IDLE;
I2CS_ReadLength = 0;
I2CS_RdIndex = 0;
//--- set pins ---
MEMMAP = 0x2;
IODIR0 = 0xF0;
IOSET0 = 0xF0;
PINSEL0 = 0x50;
//--- set i2c pll ---
I2C0SCLL = 0xD;
I2C0SCLH = 0xC;
//--- set i2c slave ---
I2C0ADR = 0x20 << 1;
//--- clear flags ---
I2C0CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC;
//--- set flags ---
//I2C0CONSET = I2CONSET_AA;
//--- Install interrupt handler ---
if ( install_irq( I2C0_INT, (void *)I2C_0_SlaveHandler ) == FALSE )
{
return FALSE;
}
I2C0CONSET = I2CONSET_I2EN | I2CONSET_AA ;
return TRUE;
}
I think this is incorrect because the interrupt is not activated.
Please help me....thaks all.
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Go through this book.every thing he mentioned clearly
-------Original Message-------
From: patrickfolci
Date: 11/13/09 19:23:39
To: l...@yahoogroups.com
Subject: [lpc2000] LPC 2144 I2C Slave
I have a problem with i2c slave because I not have the correct inizialize
procedure.
I have used this procedure:
_BOOL init_i2c_0(void)
{
I2CSlaveState = I2C_IDLE;
I2CS_ReadLength = 0;
I2CS_RdIndex = 0;
//--- set pins ---
MEMMAP = 0x2;
IODIR0 = 0xF0;
IOSET0 = 0xF0;
PINSEL0 = 0x50;
//--- set i2c pll ---
I2C0SCLL = 0xD;
I2C0SCLH = 0xC;
//--- set i2c slave ---
I2C0ADR = 0x20 << 1;
//--- clear flags ---
I2C0CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC;
//--- set flags ---
//I2C0CONSET = I2CONSET_AA;
//--- Install interrupt handler ---
if ( install_irq( I2C0_INT, (void *)I2C_0_SlaveHandler ) == FALSE )
{
return FALSE;
}
I2C0CONSET = I2CONSET_I2EN | I2CONSET_AA ;
return TRUE;
}
I think this is incorrect because the interrupt is not activated.
Please help me....thaks all.
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )