LPC54608 I2C write problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54608 I2C write problem

1,075 Views
prathap_ponnuch
Contributor I

Hi all,

We are using LPC54608 mcu. In this we tried i2c based eeprom device read and write.

Data write we followed:

void data_write(uint8_t Byte_address, uint8_t value){
I2C_MasterStart(((I2C_Type *)(I2C2_BASE)), 0x50U, kI2C_Write);
I2C_MasterWriteBlocking(((I2C_Type *)(I2C2_BASE)), &Byte_address, 1, kI2C_TransferNoStopFlag);
I2C_MasterWriteBlocking(((I2C_Type *)(I2C2_BASE)), &value, 1, 0);
I2C_MasterStop(((I2C_Type *)(I2C2_BASE)));
//delay();
}

Inside this I2C_MasterWriteBlocking function there is one more function called

status = I2C_PendingStatusWait(base);

first time (Byte_address)I2C_MasterWriteBlocking we received status = 0x805 but second time during value write this status value becomes 0x809 so it skipped without writing data into base->MSTDAT register.

Where i missed?

how to solve this.

Thanks in advance.

Regards,

prathap

Labels (1)
0 Kudos
3 Replies

1,009 Views
prathap_ponnuch
Contributor I

Hi Alice,

Problem solved its pinmux configuration issue.

Thanks for your support.

Regards,

prathap

0 Kudos

1,009 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

OK, thanks for your sharing.

0 Kudos

1,009 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello prathap ponnuchamy,

0x809 meaning   NACK Data. Slave NACKed transmitted data.

pastedImage_2.png

so please check whether address and sub address is right? Also check I2C slave work well?

Regards,

Alice

0 Kudos