i2c io expanders

Anything not related to STM32
Post Reply
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

i2c io expanders

Post by ag123 »

PCF8574 from nxp is well known enough
https://www.nxp.com/docs/en/data-sheet/ ... F8574A.pdf
But i don't really like the 'quasi bidirectional io'
nevertheless, these seemed to be the most prolific
https://www.aliexpress.com/af/pcf8574.html

then as i dug further around
I stumbled into tca9534a from TI
https://www.ti.com/lit/gpn/tca9534a
then pca9535
https://www.nxp.com/docs/en/data-sheet/ ... 535CDS.pdf
https://www.ti.com/lit/ds/scps129k/scps129k.pdf
and pca9555
https://www.nxp.com/docs/en/data-sheet/PCA9555.pdf
https://www.ti.com/lit/gpn/pca9555
they looked nearly identical except that in pca9555 it has an internal pull up resistor to VDD
fig 7, fig 8
pca9535, pca9555 seemed to be priced similarly
https://www.aliexpress.com/af/pca9535.html
https://www.aliexpress.com/af/pca9555.html
and it seemed they are 'less popular' compared to the 'old' PCF8574 as modules for these seemed 'absent' from AliX

for practical purpose, these are only useful as 'extra hands' to provide single bit gpios at each pin, it is unlikely to handle any faster switching speeds partly limited by i2c 400kbps.
they are rather useful as 'single chip' keyboard scanners vs using 74hcxxxx (e.g. 74hc595 and 74hc164 shift registers)
but are costier

i'd guess it is simplier to use a bigger stm32 chip with more pins than do use 'i2c io extenders'
but for 'low pin count' chips e.g. so8 or so20, i'd guess they may at times comes handy
dannyf
Posts: 446
Joined: Sat Jul 04, 2020 7:46 pm

Re: i2c io expanders

Post by dannyf »

You can probably write such a device yourself - it wouldn't surprise me if some of those chips are indeed a mcu + code.

I wrote a uart display that can also transmit uart to the next device. You can chain them together to drive a long string of displays (4 led).
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: i2c io expanders

Post by ag123 »

To a good extent, yup, we can probably 'daisy chain' 2 stm32g030f6p6, so that one handles 'extra' IO, but it seemed like a 'waste' of transistors :lol:
i'm thinking there could be other designs as well, e.g. one could simply be a 'display driver' say driving an LCD, possibly including decoding a 4x4 keypad, while the other mcu works on 'other stuff'

PCF8574 is still useful for the keypad as a 'single chip' solution, it probably saved some pins that way and that the PCF8574 can be built with the keypad side.

But these days there are quite interesting 'single chip' solution as like this, which uses a TM1638.
https://www.aliexpress.us/item/1005004567378575.html
https://www.handsontec.com/dataspecs/display/TM1638.pdf
it seemed TM1638 could have some interfacing issues as it is a 5v chip say vs 3.3v on stm32 (and many 3.3v devices) side
edit:
it seemed it has been interfaced successfully after all
https://github.com/gavinlyonsrepo/TM1638plus
dannyf
Posts: 446
Joined: Sat Jul 04, 2020 7:46 pm

Re: i2c io expanders

Post by dannyf »

i'm thinking there could be other designs as well, e.g. one could simply be a 'display driver' say driving an LCD, possibly including decoding a 4x4 keypad, while the other mcu works on 'other stuff'
I think so. I think i made a similar suggestion to someone who was writing a car display.

it could be that each display has the same "firmware", and the user can send "commands" (address of the display being addressed, which type of charts to draw, in what color, and where, ...) and "data". This display can be chained together or hang off a bus. One extension of that, in this context, is to for the device to re-transmit the received data, either in the same interface (daisy-chain) or in a different interface (bridge, like spi->uart, or i2c->spi).

greatly simplify your design and make it much more "user-configurable".
Post Reply

Return to “Off topic”