# iicEEPROM read and write confusion

#### Jswale

Joined Jun 30, 2015
121
Hi All,

I am working on an EVM430-F6779 using the MSP430...

I am trying to write and read back from the EEPROM using I2C.

The functions are pre-written, so I know are correct but I am unsure of how to use them/ what to look for.

C:
int iicEEPROM_write(uint16_t addr, void *dat, int len)

//my attempts
uint16_t dat = 0xFF;

iicEEPROM_write(0xA0, &dat, sizeof(dat));

iicEEPROM_read(0xA0, &dat, sizeof(dat));
Anyone with any advice on to why this isn't working?

Cheers
JSwale

#### nerdegutta

Joined Dec 15, 2009
2,676
Hi.

Which IDE do you use?

#### Jswale

Joined Jun 30, 2015
121
I am using the IAR Embedded Workbench 6.30.3

#### nerdegutta

Joined Dec 15, 2009
2,676
OK, I thought it would be easier to work with the Energia IDE.
I've never used it but I think it is similar to the Arduino IDE. With lots of libraries. I'm on thin ice here, so I might be wrong.

#### Jswale

Joined Jun 30, 2015
121
Yeah, I need to use the IAR workbench because of the supplied code for my development box. I am more interested in the syntax that I am having a problem with.

#### Jswale

Joined Jun 30, 2015
121
C:
                    {
int *write_dat;
int data = 5;
write_dat = &data;
iicEEPROM_write(0x20, write_dat, 1);

uint8_t value;
}