I2C slave data receiving

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I2C slave data receiving

1,118 次查看
bvpmysore
Contributor I

Hi,

I have configured S32K148 board, made i2c1 as master and i20 as slave. Once the 7-bit slave address is sent by the master, getting ACK from the slave and I am getting address match flag(AMF) and address valid flag(AVF) as 1. After that when I am trying to send a data byte, Receive data flag (SSR[RDF]) is getting set which means (from the DS) receive data is ready. But once RDF is 1, the Slave Receive Data Register(SRDR) is not getting updated, when I try to read SRDR, the RDF is getting reset. So How the data which is received by slave is stored in SRDR or any other register ?

Can anyone help me with this issue, any help would be appreciated.

Regards,

Prajwal B V

0 项奖励
回复
1 回复

1,107 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @bvpmysore,

There are two ways to read it depending on SCFGR1[RXCFG].

Please keep in mind that the debugge can read the Receive Data Register and clear the flags too.

It is better to close the register view and use the core to copy the registers to some variables.

If RDF = 1, RXCFG = 0, you should be able to copy the received byte to a variable.

 

Regards,

Daniel

 

 

0 项奖励
回复