FRDM-KL46Z : question on I2C slave adress automatic detection method

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

FRDM-KL46Z : question on I2C slave adress automatic detection method

1,311 Views
r58737
NXP Employee
NXP Employee


Hello,

I'm using a FRDM-KL46Z platform and I want to use I2C communication.

With processor expert , I set a I2C serial components as Master and I want to detect all the slave devices connected to this I2C bus.

I see a method named  "I2Cx-SelectSlaveDevice(MyI2Cptr, LDD_I2C_ADDRTYPE_GENERAL_CALL,devAddr)".

Could someone give me an example on how to use this method to detect  slave devices connected to the I2C bus.

I want to be able to select after this detection a device present on the bus and start communication.

Thanks

BR

Philippe

0 Kudos
3 Replies

549 Views
BlackNight
NXP Employee
NXP Employee

Hi Philippe,

I'm scanning the I2C bus with a special I2C Processor Expert component (see CSI Crime Scene Investigation with I2CSpy and Freedom Board | MCU on Eclipse). Selecting the slave is not enough: you need to read/write to the device, as only then the bus is accessed.

You can find the component code on GitHub here: mcuoneclipse/Drivers/sw/I2CSpy.drv at master · ErichStyger/mcuoneclipse · GitHub

I hope this helps,

Erich

0 Kudos

549 Views
r58737
NXP Employee
NXP Employee


Hi Erich,

seems interesting, I will try it.

I will download the I2CSpy.Peupd file. Could you tell me were I have to save it?

Do  you have any kinetis  example of it?

Thanks

Rgds

Philippe

0 Kudos

549 Views
BlackNight
NXP Employee
NXP Employee
0 Kudos