Read I2C Data Line

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

Read I2C Data Line

781 次查看
burgeh
Contributor IV

Greetings,

I am currently using the MK22FN256LVH12 Microcontroller with KDS v3.2 with Processor Expert.

I have an i2c sensor that I was forced to bit-bang to get the correct data out of it. So I have been manually clocking the bits in and out. However, is there a built in function, or way I can read the data line into an array so I can actually use the data I am getting? The drivers for Processor Expert can't follow the protocol so I cannot use those.

Thoughts?

0 项奖励
1 回复

468 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Christopher Burg,

   About the MK22FN256LVH12 I2C code, I recommend you to refer to the SDK code from this link:

   https://mcuxpresso.nxp.com/en/builder 

You can download the MK22FN256LVH12 SDK code, and refer to it's I2C project.

  You can modify that I2C project to meet your i2c sensor demand.

  If you still have problems, then you need to use the logic analyzer tool to snatch the I2C bus wave, and associated with your sensor datasheet, check which point is not meet your sensor's demand.

Wish it helps you!

If you still have question about it, please kindly let me know.


Have a great day,
Kerry

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

0 项奖励