Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I2C io interface
#3
Hi Dan,

At the moment I'm testing with a boardless IC. It is the PCF8574 which officially is called "Remote 8-bit I/O expander for I2C" 
The datasheet you can find here.  Also this wiki gives some usefull info

There are many boards based on this chip. The most famous board is the one for 2x16LCD displays. Also a lot of IO boards are available for almost nothing from Asia. The one I showed is likely the most useful because it can be daisy chained to the next board without soldering. Also the I2C adres can be manually set via jumpers. 

The PCF8574 can have 8 different adresses (0x20..0x27) so one could connect 8 boards together. 8 boards x 8 I/O pins gives a potential of 64 channels to adress.

The testing I did both from the command line and from a minimal python script.
From the command line you can set (or get) a port with i2cset, like "i2cset -y 1 0x27 0x08" where 1 is the smbus id (usually 1), 0x27 is the I2c adress (module with no jumpers) and 0x08 is pin 4 of the PCF8574. The pins is a bitmask so to set pin 3 (0x04) and 8 (0x80) you send 0x84.

From python it is also really easy. To set pin 4 like the example above the minimal code is:

Code:
import smbus
bus = smbus.SMBus(1)
bus.write_byte(0x27, 0x08)


I think this could be a useful addition to SIP so a plugin might be the best approach. The internals of SIP are not always clear to me but I can give it a try to write a plugin. If I'm correct the plugin should listen to a signal when to do its thing. Correct?

Hopefully this gives you some info to "judge" my thoughts.

--Gerard
Reply


Messages In This Thread
I2C io interface - by astrogerard - 2021 Aug 12, 01:54 PM
RE: I2C io interface - by dan - 2021 Aug 12, 07:56 PM
RE: I2C io interface - by astrogerard - 2021 Aug 13, 09:27 AM
RE: I2C io interface - by dan - 2021 Aug 13, 01:21 PM
RE: I2C io interface - by astrogerard - 2021 Aug 14, 04:26 PM
RE: I2C io interface - by dan - 2021 Aug 14, 05:02 PM
RE: I2C io interface - by astrogerard - 2021 Aug 14, 05:45 PM
RE: I2C io interface - by dan - 2021 Aug 18, 07:34 PM
RE: I2C io interface - by astrogerard - 2021 Aug 19, 09:29 AM
RE: I2C io interface - by astrogerard - 2021 Aug 23, 11:27 AM
RE: I2C io interface - by dan - 2021 Aug 23, 01:26 PM
RE: I2C io interface - by astrogerard - 2021 Aug 24, 08:58 PM
RE: I2C io interface - by astrogerard - 2021 Aug 26, 03:48 PM
RE: I2C io interface - by dan - 2021 Aug 26, 06:33 PM
RE: I2C io interface - by astrogerard - 2021 Aug 26, 07:10 PM
RE: I2C io interface - by astrogerard - 2021 Sep 16, 11:11 PM
RE: I2C io interface - by dan - 2021 Sep 19, 07:52 PM
RE: I2C io interface - by astrogerard - 2021 Sep 26, 10:13 PM
RE: I2C io interface - by astrogerard - 2021 Oct 18, 08:35 PM
RE: I2C io interface - by dan - 2021 Oct 19, 02:21 PM
RE: I2C io interface - by dan - 2021 Oct 19, 04:51 PM
RE: I2C io interface - by astrogerard - 2021 Oct 19, 08:40 PM
RE: I2C io interface - by litronas - 2022 Jan 10, 03:04 PM
RE: I2C io interface - by astrogerard - 2022 Jan 10, 04:45 PM
RE: I2C io interface - by litronas - 2022 Jan 10, 08:35 PM
RE: I2C io interface - by astrogerard - 2022 Jan 11, 03:17 PM
RE: I2C io interface - by litronas - 2022 Jan 15, 08:54 PM
RE: I2C io interface - by astrogerard - 2022 Jan 17, 04:30 PM
RE: I2C io interface - by litronas - 2022 Jan 17, 08:35 PM
RE: I2C io interface - by astrogerard - 2022 Jan 17, 08:51 PM
RE: I2C io interface - by dan - 2022 Jan 17, 09:27 PM
RE: I2C io interface - by astrogerard - 2022 Jan 17, 09:50 PM
RE: I2C io interface - by dan - 2022 Jan 18, 03:11 PM
RE: I2C io interface - by astrogerard - 2022 Jan 18, 03:40 PM
RE: I2C io interface - by litronas - 2022 Jan 18, 07:39 PM
RE: I2C io interface - by litronas - 2022 Jan 19, 08:03 PM
RE: I2C io interface - by astrogerard - 2022 Jan 20, 12:49 PM
RE: I2C io interface - by astrogerard - 2022 Jan 20, 03:11 PM
RE: I2C io interface - by astrogerard - 2022 Jan 20, 05:32 PM
RE: I2C io interface - by litronas - 2022 Jan 21, 03:11 PM
RE: I2C io interface - by litronas - 2022 Jan 20, 09:35 PM
RE: I2C io interface - by astrogerard - 2022 Jan 20, 10:05 PM
RE: I2C io interface - by litronas - 2022 Jan 21, 09:57 AM
RE: I2C io interface - by astrogerard - 2022 Jan 21, 07:50 PM
RE: I2C io interface - by litronas - 2022 Jan 24, 09:40 PM
RE: I2C io interface - by astrogerard - 2022 Jan 25, 03:00 PM
RE: I2C io interface - by dan - 2022 Jan 25, 03:43 PM
RE: I2C io interface - by astrogerard - 2022 Jan 25, 04:38 PM
RE: I2C io interface - by litronas - 2022 Mar 18, 04:21 PM

Forum Jump:


Users browsing this thread: 20 Guest(s)