Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A64 => Topic started by: ilario on January 10, 2025, 01:30:16 PM

Title: Using TWI0 i2c-0 on A64-OLinuXino
Post by: ilario on January 10, 2025, 01:30:16 PM
Dear all,
I just wanted to share my experience trying to use the i2c-0 TWI0 bus on an A64-OLinuXino, in case anyone else was also interested to do that.

First thing, I selected the overlay for TWI0 (sun50i-a64-i2c0.dtbo) from olinuxino-overlay.

On an A64-OLinuXino A64-OLinuXino-2Ge8G-IND hardware revision E I managed to use it via the LCD port (I was using a 20-wires cable, aligned so that I could access the pins for TWI0). In the revision E, the TWI0 pins are exposed only on the LCD port, and they worked nice :)

Now that I set up another machine, this time a A64-OLinuXino A64-OLinuXino-2Ge16G-IND hardware revision G, using the LCD port was not a good option anymore, as weird things started happening to the ethernet connection (and some times even with the serial one).

Simply connecting the 40-wires LCD cable (https://www.olimex.com/Products/Components/Cables/FPC-40-0-5-150/), without anything else connected I observe a packet loss of 30% for ping.
If I additionally connect a connector like this (https://www.adafruit.com/product/4904) on the other end of the LCD cable, the ethernet port has a packet loss of 100% for ping.

Luckily, in the hardware revision G, the TWI0 is exposed also on the MIPI-DSI port, and connecting a flat 20-wires cable there I could use TWI0 without observing any problem.
Title: Re: Using TWI0 i2c-0 on A64-OLinuXino
Post by: LubOlimex on January 10, 2025, 04:03:49 PM
Yes, LCD and Ethernet are multiplexed. Hence the hardware PTH jumper to enable one or the other - but you also need to run the display configuration script and disable LCD (since the software still has the pins initiated one way or another).
Title: Re: Using TWI0 i2c-0 on A64-OLinuXino
Post by: ilario on January 13, 2025, 03:48:03 PM
Hi!
The PTYRST jumper is open and I have no device tree overlay activating the LCD.

Running olinuxino-display and deactivating the LCD does not result in any change in /boot/uEnv.txt (as expected) but just in these error messages complaining about /uboot.env:

Read error on /uboot.env: Attempted to read 131072 bytes but got 8192
Error: environment not initialized
Read error on /uboot.env: Attempted to read 131072 bytes but got 8192
Error: environment not initialized

So my system is configured for using the ethernet port, not the LCD.

It was surprising for me that plugging a 20 or 40 wires flat cable in the LCD port was causing packet loss on ethernet. But no real problem here, simply I had to use the TWI0 pins exposed on the MIDI-DSI.