Hi all,
I am tryin to interface serial EEprom CAT24WC01 to ARM based LPC2132 using I2C only.
Has anyone worked on this set up before , or has anyone already written drivers for same already ?
If someone has already done this please send me info about this ... I am in kind of a hurry to finish this .
Regards Amit
My Programm is for ADuC7026 and 24C16. Maybee helpful. Some registernames are to be adapted.
//my global variables unsigned char dat[2048]; unsigned int i,k;
//************************************************************************** void eeprom_read() { for(k=0;k<256;k++) { i = 0; I2C1ADR = 0xA0+((k>>5)<<1); // set i2c address(LSB = 0, Master Write) I2C1MTX = (k<<3)&255; // send i2c byte address delay(4000); I2C1ADR = 0xA1+((k>>5)<<1); // set i2c address(LSB = 1, Master Read) I2C1CNT = 7; // 8 bytes to be read from slave while(i < 8){} } } //************************************************************************** void IRQ_Handler() __irq __ram { if(I2C1MSTA & 0x8) dat[(k<<3)+i++] = I2C1MRX; } //**************************************************************************