Read I2C Data Line

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

Read I2C Data Line

1,007 Views
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 Kudos
Reply
1 Reply

694 Views
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 Kudos
Reply