Can we use some LED pins to drive an I2C bus ?
I’m not sure exactly what you’re asking for-- are you asking if the hardware I2C is available on those pins, or whether it’s possible to bit-bang a couple of them to emulate I2C in software? There’s no reason I know of that you couldn’t pick any of the LED pins to serve as SDA and SCL. Obviously you need to find out the correct method for driving the correct pins and setting the SDA pin to an input/output as needed, but that shouldn’t be too hard. There’s quite a bit of discussion and info on using random pins on the AR9331 with OpenWrt for I2C (And other applications) here:
HTH. We’re somewhat at the mercy of the Domino creators as far as support goes for these type of hardware questions since there is no public manual available for the AR9331, and if someone hasn’t already tried it on a AR9331-based OpenWrt router it could be very challenging to implement something new. You’ll end up reading through the Linux kernel drivers for the platform and hoping you can find something meaningful
Yes, I means bitbanging I2C.
I’ve remember that even GLiNet routers was providing some GPIOs which can be used as I2C bus.
Since Domino and GLiNet is the same company, I hope they can provide such info.
Maybe Squonk can come to our rescue here …
Squonk is super busy at this moment. I will get hold of him.
I understand that Squonk is super busy right now !
A bit of French here : Michel ? nous savons tous que tu es très occuppé, mais donnes signe de vie sur ce forum, svp !
Why I wish to involve Squonk into this thread, it is because we need to have ways to attached external hardwares on the Domino, otherwise the Domino will never become an IoT device, it will be only router like any others OpenWRT ones.
I’ve got a bit further on this side :
I’ve made a small tile with an MCP23017 GPIO Expander.
At first, it didn’t run. Looking at the scope, the I2C Bus wasn’t strong enough since the LEDs GPIO seems to be at 2.5V and not at 3.3V, so I added voltage level-shifter using 2N7000.
It is now working, but only with command line I2C tools, such as i2cset, because python-smbus is crashing (SegFault) in the current distribution.
I’ve posted the following link : OpenWrt Forum Archive
How did you write Code/Compile for this I2C ?
It is possible, but i can’t say anything about your hardware? Can you please share the architecture and the pin diagram of the MCU board? Also share its all specifications if you can.
I want to go through your firmware, so that if any changes required i could suggest them.