Using TWI0 i2c-0 on A64-OLinuXino

Started by ilario, January 10, 2025, 01:30:16 PM

Previous topic - Next topic

ilario

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, without anything else connected I observe a packet loss of 30% for ping.
If I additionally connect a connector like this 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.

LubOlimex

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).
Technical support and documentation manager at Olimex

ilario

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.