I am developing an application using the new Mikromedia HMI 7" display and the Mikromedia HMI breakout board. The application required that I get data from an I2C peripheral. I have implemented a number drivers for this peripheral in the past and have used them to confirm that the peripheral is working as expected.
I have implemented my code using the only FT90x example available. The I2C_Simple example for the EasyFT90x V7
I have initialized the I2C Module using
I2CM1_Init(_I2CM_SPEED_MODE_STANDARD, _I2CM_SWAP_DISABLE);
and read the device using
I2CM1_Set_Slave_Address(SLAVE_ADDRESS);
I2CM1_Write(0x01);
I2CM1_Read(rxData);
And nothing...
I have a scope attached to the I2C0_SCL and I2C0_SDA lines on the breakout board and I have nothing...
I can see that the library functions show...
I2CM1_XXXX
and the breakout board shows
I2C0 SCL and I2C0 SDA
The help files are confusing as they note
I²C library routines require you to specify the module you want to use. To select the desired I²C module, simply change the letter n in the routine prototype for a number from 0 to 5.
But there is no letter n in the routine prototype to change.
I was hoping someone from Mikromedia could answer a couple of questions...
Is there an I2C example for the Mikromedia HMI?
Does the I2C library functions which reference I2CM1 actually control I2C0 on the processor?
Thanks
Mike
I2C on Mikromedia HMI 7" with breakout board
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: I2C on Mikromedia HMI 7" with breakout board
Hi,
I will take a look in it, test it and let you know about the results.
Regards,
Nadir
I will take a look in it, test it and let you know about the results.
Regards,
Nadir
Re: I2C on Mikromedia HMI 7" with breakout board
Thanks, much appreciated
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: I2C on Mikromedia HMI 7" with breakout board
Hi,
Yes, I2CM1 in the code controls I2C0 on the MCU.
If you want to make mikromedia HMI as Slave, I recommend to use SPI Slave on MAIN Connector .
But, I will make a simple project for mikromedia HMI 7", which represents I2C function.
Regards,
Nadir
Yes, I2CM1 in the code controls I2C0 on the MCU.
If you want to make mikromedia HMI as Slave, I recommend to use SPI Slave on MAIN Connector .
But, I will make a simple project for mikromedia HMI 7", which represents I2C function.
Regards,
Nadir
Re: I2C on Mikromedia HMI 7" with breakout board
Thanks Nadir,
I am trying to make the Micromedia HMI the Master and my peripheral the Slave.
I have a scope on the I2C lines and don't see anything. I am clearly doing something wrong to initialize the I2C, and example would be much appreciated.
Mike
I am trying to make the Micromedia HMI the Master and my peripheral the Slave.
I have a scope on the I2C lines and don't see anything. I am clearly doing something wrong to initialize the I2C, and example would be much appreciated.
Mike
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: I2C on Mikromedia HMI 7" with breakout board
Hi,
Please, can you attach here the detailed photos of your hardware configuration ?
Also, you can attach here your project in zip.
Regards,
Nadir
Please, can you attach here the detailed photos of your hardware configuration ?
Also, you can attach here your project in zip.
Regards,
Nadir
Re: I2C on Mikromedia HMI 7" with breakout board
Thanks Nadir,
I attached the project I created and a photo of the hardware. We are using the Micromedia HMI 7" display to show the status of a battery which includes a charging circuit and monitor. The Mikromedia HMI 7" Display is connected to a Mikromedia HMI breakout board which is in-turn connected to a shared ground and the SDA and SCL lines from the battery.
I have code running on a ARM Cortex M4 processor which reads the battery status properly using 12C.
I have connected a scope to the I2C0_SCL and I2C0_SDA lines on the breakout board and I don't see any communication from the processor.
I2CM1_Write() always returns _I2CM_STATUS_ERROR
Mike
I attached the project I created and a photo of the hardware. We are using the Micromedia HMI 7" display to show the status of a battery which includes a charging circuit and monitor. The Mikromedia HMI 7" Display is connected to a Mikromedia HMI breakout board which is in-turn connected to a shared ground and the SDA and SCL lines from the battery.
I have code running on a ARM Cortex M4 processor which reads the battery status properly using 12C.
I have connected a scope to the I2C0_SCL and I2C0_SDA lines on the breakout board and I don't see any communication from the processor.
I2CM1_Write() always returns _I2CM_STATUS_ERROR
Mike
- Attachments
-
- BatteryCharger.zip
- (1.1 MiB) Downloaded 168 times
-
- BatteryCharger.JPG (2.11 MiB) Viewed 5785 times
- nadir.celebic
- mikroElektronika team
- Posts: 465
- Joined: 15 Jun 2016 13:19
Re: I2C on Mikromedia HMI 7" with breakout board
Hi,
For I2C communication you need some I2C module, in this case I used the EEPROM click
http://www.mikroe.com/click/eeprom/ and mikromedia HMI 5".
Please take a look on photo in attachment and try I2C example.
NOTE: If you don't have I2C module you will not get a signal on an oscilloscope.
For I2C communication you need some I2C module, in this case I used the EEPROM click
http://www.mikroe.com/click/eeprom/ and mikromedia HMI 5".
Please take a look on photo in attachment and try I2C example.
NOTE: If you don't have I2C module you will not get a signal on an oscilloscope.
- Attachments
-
- IMAG0209.jpg (2.09 MiB) Viewed 5554 times
-
- I2C Simple.zip
- (110.7 KiB) Downloaded 189 times