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
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
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
Hi Philippe,
Download and import the two *.PeUpd files as described here:
http://mcuoneclipse.com/2013/05/09/processor-expert-component-peupd-files-on-github/
(points to mcuoneclipse/PEupd at master · ErichStyger/mcuoneclipse · GitHub)
An example for the FRDM-KL25Z is here: mcuoneclipse/Examples/FRDM-KL25Z/Freedom_I2CSpy at master · ErichStyger/mcuoneclipse · GitHub
(best if you download things in a zip file: https://github.com/ErichStyger/mcuoneclipse/archive/master.zip)
Erich