Reading KL25Z data in I2C1_D

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

Reading KL25Z data in I2C1_D

713 次查看
us1
Contributor III

Hello,

I have a problem reading data from the I2C1_D Register for my KL25Z.

I have when running in a while loop on the logic analyzer the 0x3A Data.

But when working with the start-stop-breakpoint debugging, I have other data in this register.

How is this register organized? Where is the least significant bit and where the most significant bit?

Thank you

3 回复数

472 次查看
us1
Contributor III

Hi,

I have values in every Most Signigicant Byte and Least Significant byte, but could it be that the problem is not having the dummy read?

What is the requirement to leave the dummy read?

thank yoou

0 项奖励

472 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Ulrich:

Sorry, after reading your post I am not understanding your issue clearly. The I2C data register (I2Cx_D) is a single byte with bits organized in the conventional order:

pastedImage_0.png

I attach a very simple sample project which I shared a while ago that communicates a KL25-Master to a KL25-Slave through I2C. The master simply issues a read command and then the slave sends 10 consecutive bytes. Maybe this project helps you as reference.

You could also download KSDK for KL25 and you will find I2C example projects:

Software Development Kit for Kinetis MCUs|NXP

Let me know if you have doubts or your issue persists.

Best regards,

Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

472 次查看
us1
Contributor III

Hi @Jorge_Gonzalez

the problem I had: There was the wrong value in the I2C1_D Register!!! Sensor send the right one.

This was, because my code was missing the Dummy read!

NXP should add this to their handbook, if you work after the reference manual!!!

0 项奖励