MC1322X I2C programming

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

MC1322X I2C programming

888 Views
harishvenkatach
Contributor III

Hello All,

     I am trying to program MC1322X-SRB board for I2C communication as a slave. When I try to find the slave address using arduino I2C scanner code(to get the I2C slave address), it shows "no I2C device found".

     I use Beekit to program the device and IAR workbench to compile it. While setting up the environment in Beekit, I set enable I2C to TRUE in the IIC_interface.h file.

Is there any other setup I need to take care of to enable I2C communication in MC1322X as slave?

Regards,

Harish Venkatachalam

0 Kudos
3 Replies

740 Views
AngelC
Senior Contributor I

Hello Harish,

What exactly are you trying to achieve? Would you like to control the MC1322V as a blackbox or simply read stored data? Please describe a little bit more your application.

Furthermore, are you using any of the in-ROM IIC drivers of the device? These drivers feature the basic functionality of I2C such as send data, read data, initialization, etc. You can find a description of its usage and its APIs in the MC1322x Software driver reference manual (22xDRVRM.pdf) included in BeeKit’s documentation folder.

Regards,

AngelC

0 Kudos

740 Views
harishvenkatach
Contributor III

Hi AngelC

I am trying to send data from a MCU (KM34Z50M) to MC1322X-SRB board in I2C communication.

For the I2C communication to be setup, I need the slave address of the MC1322x, but unable to find the same using the I2C scanner of arduino.

I want my MC1322X to read data from the MCU.

Could you please help me with this.

Regards

Harish Venkatachalam

0 Kudos

740 Views
AngelC
Senior Contributor I

Hello Harish,

As described in the reference manual, the address compare block determines if a slave has been properly addressed, either by its slave address or by the general broadcast address (which addresses all slaves).  I ignore how the Arduino I2C scanner works, but it should send broadcast messages to look for slave devices. 

Nevertheless, the I2C module responds to a general call (broadcast) command only when I2CCR[BCST] is set.  By default the BCST bit is disabled so it will not accept broadcast commands. Therefore, you should first initialize I2C module in MC1322x so it could either accept broadcasts or use a known slave address, which you can use to communicate with the MCU form the host controller.

To initialize the module properly please refer to the Reference manual. You could also use the Sound.c file of BeeKit project (Utilities folder) as reference since it initializes and uses I2C module.

Regards,

AngelC

0 Kudos