external I2C component with PE

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

external I2C component with PE

1,073 Views
syed_idris
Contributor III

Hi,

We didn't find any example for I2C component for external components connected to Kinetis with PE. while going through fsl_i2c component I am getting confuse between I2C mode selection as master or slave,this mode selection is as per controller side or device side?

means if I am connecting I2C component to Kinetis controller (Controller as master and device as slave) then I have to select I2C master mode, am I correct?

in component inspector for master mode we have to write address of slave?

where to define the slave data register which I want to read from slave?

 

I2C example with PE is also appreciated.

 

Idris

Labels (1)
Tags (2)
7 Replies

805 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello syed,

Which chip do you used ?

I recommend you can fist check these basic demo code :

pastedImage_0.png

Hope it helps

Alice

0 Kudos

805 Views
syed_idris
Contributor III

Hi Alice,
I am using KL03 chip and fsl_i2c component, and I didn't get that "typical usage" in "help on component"

Capture.PNG

Idris

0 Kudos

805 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello syed,

Yes, under KSDK , there is no PE demo, you can refer to

the sample under KSDK installation directory :

KSDK_1.3.0\examples\frdmkl03z\driver_examples\i2c

Hope it helps


Have a great day,
Alice

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

0 Kudos

805 Views
syed_idris
Contributor III

Alice_Yang , DavidS
I tried with that example code and made one simple project but it is not responding correctly,
I want to read 2 bytes from register 0x05 of slave (device address: 0x18).
please have a look to a project and suggest how to read slave device,
Should I call I2C_DRV_MasterReceiveData() or I2C_DRV_MasterReceiveDataBlocking() function?
Is there something wrong in I2C_DRV_MasterReceiveData() function calling parameters?

Output:
Before : 1 ff
After : 1 ff

Idris

0 Kudos

805 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Syed,

How about the function of "I2C_DRV_MasterReceiveDataBlocking()" ?

BR

Alice

0 Kudos

805 Views
syed_idris
Contributor III

Alice,

"I2C_DRV_MasterReceiveDataBlocking()" function is also responding same for 2 bytes reading.

0 Kudos

805 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Syed,

I checked you have the same question  on another thread , i will reply you on that one .

Hope it helps

Alice