I am using Pin27 and Pin28 as USB, so I cannot use I2C-4. According to the documentation, I2C3 is occupied by the kernel. Which I2C bus can I use?
Which I2C can I use without I2C-3 I2C-4
The only I2C currently available on the 40PIN GPIO is I2C-4.
Looking at the overlays, there are actually 3 different i2c interfaces available on the 40 pin GPIO header.
i2c4-m0 is the only one that’s shown on the hardware page:
https://docs.radxa.com/en/zero/zero3/hardware-design/hardware-interface.
“On Radxa ZERO 3 this is SDA pin 27 and SCL pin 28”
i2c5-m0 is available on the 40 pin header and unused as far as I can tell
“On Radxa ZERO 3 this is SDA pin 31 and SCL pin 29”
i2c3-m0 is available on the 40 pin header but address 0x36 is masked and is in use by a driver.
“On Radxa ZERO 3 this is SDA pin 3 and SCL pin 5.”
All 3 overlays are available and I’ve connected a device to all three to verify that they work.
Hey Mitchell,
Good morning!
Can confirm that my i2c device is picked up and works at the default frequency on i2c5-m0 using the appropriate radxa overlay on pins 29 31. I am running on armbian noble but that shouldn’t matter.
spot@spotzero:~$ sudo i2cdetect 5
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-5.
I will probe address range 0x08-0x77.
Continue? [Y/n]
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
It’s a VL53L5CX 8x8 TOF imager.
Print data no : 139 (52.3ms)
Distance values: Status values:
245 232 248 251 246 255 005 005 005 255 005 005 255
232 241 244 243 247 241 236 255 005 005 005 005 005 005 005
249 234 247 249 250 247 252 257 005 005 005 005 005 005 005 005
251 248 243 248 242 248 242 256 005 005 005 005 005 005 005 005
260 252 250 244 250 244 254 862 005 005 005 005 005 005 005 005
870 255 255 255 255 255 255 255 005
884 255 255 255 255 255 255 255 004
255 255 255 255 255 255 255 255
And for anyone else looking, you can override the default frequency for i2c i2c5-m0 using this overlay:
rk3568-zero3-i2c5-1Mhz.zip (422 Bytes)
/dts-v1/;
/plugin/;
/ {
metadata {
title = "Set I2C5-M0 to 1Mhz";
category = "misc";
compatible = "radxa,zero3";
description = "Set I2C5-M0 to 1Mhz";
};
fragment@0 {
target = <&i2c5>;
__overlay__ {
clock-frequency = <1000000>; // Set to 1MHz
};
};
};