InternalI2C Component and Functions

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

InternalI2C Component and Functions

939 Views
burgeh
Contributor IV

Greetings!

I have a question regarding the InternalI2C component with the KDS processor expert. I am using the K22 FRDM board. I am trying to use this component for I2C communication, with not a completely standard protocol. I am required to send the device address to the sensor to wake it up. I am then to wait around 1ms before issuing the stop flag. However, I have noticed that after issuing sendblock method if I use a wait function or any other function the I2C lines issue a stop signal right away. For example I issue the sendblock it sends the data, I call a wait for 1ms, but right once it is called (before it waits 1ms) it issues the stop. I tried using dummy functions to check if it was just the wait function, but it appears to be whenever any function is called.

So my question is, is there anyway to get around this? Somehow set the function to be non-blocking of sorts?

Thanks!

Labels (1)
0 Kudos
6 Replies

651 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Christopher ,

 Could you please share your code ?

The function of SendBlock() includes whether send stop signal :

pastedImage_1.png

Also there is typical usage about the I2C_LDD component , you can have a look :

Right click I2C component -> Help on component -> Typical Usage :

pastedImage_2.png


Have a great day,
TIC

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

0 Kudos

651 Views
burgeh
Contributor IV

I am using the internalI2C component not the I2C_LDD. The code is shown below.

pastedImage_1.png

InternalI2C component below.

pastedImage_2.png

0 Kudos

651 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Christopher,

Could you please check the Properties view , whether check the "Automatic stop condition" ?

If yes, please uncheck it :

pastedImage_1.png

Hope it helps


Have a great day,
TIC

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

0 Kudos

651 Views
burgeh
Contributor IV

It is unchecked, image below.

pastedImage_1.png

0 Kudos

651 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi ,

Your code includes I2C1_SendStop() function , how about delete it ?

pastedImage_1.png

0 Kudos

651 Views
burgeh
Contributor IV

Well, I get an error that the bus is off when I issue that command. I need to delay a certain amount of time before I send the stop flag in I2C. Right when the Waitms(1) command happens the I2C lines are let to go high (Basically issuing a stop).

0 Kudos