LPC54608 I2C write problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC54608 I2C write problem

1,098件の閲覧回数
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

ラベル(1)
0 件の賞賛
3 返答(返信)

1,032件の閲覧回数
prathap_ponnuch
Contributor I

Hi Alice,

Problem solved its pinmux configuration issue.

Thanks for your support.

Regards,

prathap

0 件の賞賛

1,032件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

OK, thanks for your sharing.

0 件の賞賛

1,032件の閲覧回数
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 件の賞賛