AnsweredAssumed Answered

Write/Read 24AA00 E2PROM with LPC1114

Question asked by Thiago rodrigues on Sep 27, 2019
Latest reply on Oct 9, 2019 by Ian Benton

Hello,

 

I´ve been trying to read/write a small EEPROM memory via I2C functions as attached, but it does not seem to work.

 

In my code I call:

 

 

static uint8_t bufeprom[2];

static uint8_t bufeprom1[2];

static uint8_t bufread1[1];

static uint8_t bufread2[1];

I2C_Init(I2CMASTER, 0, 0, 0);

I2C_Read(0xA0, bufread1, 1);

//read EEPROM

I2C_Read(0xA0, bufread2, 1);

/////////////////////

bufeprom[0] = 0x01;

bufeprom[1] = 0x10;

bufeprom1[0] = 0x02;

bufeprom1[1] = 0x10;

I2C_Write(0xA0, bufeprom, 2);

I2C_Write(0xA0, bufeprom1, 2);

 

After the I2C_Init, I send two read commands to read 1 byte each, since the memory address is incremented automatically by the 24AA.

The write procedure has two parameters, the address and the data to be written, so two comands are sent for two bytes (addresses 0x01 and 0x02).

 

I´ve tried a lot of things and nothing. And yes, the 24AA has pull-up resistors on the SDA and SCL lines.

 

Does anyone has experience with LPC and E2PROM memories?

 

Regards,

Attachments

Outcomes