I2C on Colibri iMX7 and WEC2013

Hi,
I want to use the I2C Interface to control an IO Expander (to have a ePaper Display and some LEDs). The RTC is also using the I2C (on Iris V1.1), so is there any Chance to use the I2C Interface from my app without disturbing the RTC communication?
Is the I2C exclusively used by the RTC (and the WEC 2013 Driver for it)

Thanks a lot for helping.

With best regards

Gerhard

Dear @Gerhard

The i2c software is protected with mutexes. If you use our Toradex Ce libraries, it is perfectly fine to connect your IO expander to the same i2c bus.

The RTC is accessed pretty rarely - basically during system boot, and when you change the system time (manually or by a network time server). So you typically don’t need to worry about any delay in your IO expander communication.

Regards, Andy

Hi Andy,

I just read that there is a built in RTC too, but it is not recommended for usage cause the power consumption is high.
No Problem, will use the design I found on the Iris board, but … how did the system know, which RTC is the right one to use?

I will use a very accurate crystal, cause the prototype of my system using the Iris board for now did run away form the accurate time very quickly.

With best regards

Gerhard

Dear @Gerhard

There is a small number of RTCs supported. By default the system assumes there’s a M41T0 device at i2c slave address 0x68.
If you need a different configuration, you need to change the registry.

If you go for a device which is not supported, we can provide you a framework so you can add support for your device, too.

Regarding the crystal, be aware that a regular precise crystal is not sufficient. You probably need a temperature compensated or even temperature controlled oscillator.

Regards, Andy

Hi Andy,
ok, the system uses the external RTC, not the RTC on/in the SoC.
I will use the chip Toradex uses on the IRIS board, but in the manual of the chip, the I²C address reads as 0xD0. But no problem, I don’t have a divice with this address or 0x68 as you wrote in your post.

We will always try to have a connection to mobile Internet, so the time will be correct, but if we can’t do so, we need a reasonable correct time for about a day or two and a ±10ppm crystal will hopefully do that job. Otherwise the user has to correct the time once a day, which is aceptable for a measurement System used in the field.
And there is a GNSS Receiver included too, so I can take the time from there with just some line of codes and a task starting lets say every hour or so.

With best regards

Gerhard

Dear @Gerhard

I2c Address

This is just a different way to express the address

  • 8bit: 0xD0=write, 0xD1 = read
  • 7bit 0x68 (which is 0xD0 / 2) plus 1bit Read/nWrite

Workarounds

  • The external RTC is only synced on system boot, and on manual request. Try to call RTCSync.exe without parameter to force synchronization M41T0 → system. Maybe this helps.

  • You can also try whether it is related to the known issue #22706.

Regards, Andy