Тёмный

GPIO tinkering: 8 port expander 

pileofstuff
Подписаться 17 тыс.
Просмотров 3,8 тыс.
50% 1

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@James-Garner-82
@James-Garner-82 Год назад
These (PCF8574's) are useful little chips, handy for extra GPIO. But also the PCF8591's are good for analog GPIO too, all of the PCF's are always great arduino-type add-on chips though.
@frankowalker4662
@frankowalker4662 Год назад
Great little chip with so many uses.
@IanSlothieRolfe
@IanSlothieRolfe Год назад
I've seen these chips used on those I2C backpacks for LCD displays, it operates the display in 4 bit data mode and the driver handles the protocol. I've got some MCP23017 16 output expanders which are similar but a bigger chip that I used with an ATTINY but I don't really know why I didn't just use an ATMEGA328 :)
@fredflintstone1
@fredflintstone1 Год назад
Nice to see someone else tinkers🙂
@RonDogInTheHouse
@RonDogInTheHouse Год назад
These really shine when using a micro with limited pins, to say drive an LCD or where you just need additional pins. You can also use them as inputs, as in I2C read.
@henrikjensen3278
@henrikjensen3278 Год назад
Instead of writing the inverted bit pattern, use the invert operator: 0xfe -> ~0x01 0xfd -> ~0x02
@pileofstuff
@pileofstuff Год назад
I'll have to look into that more. Thanks.
@tonysheerness2427
@tonysheerness2427 Год назад
IBM used Libraries, then it became programmes, then it became applications and now back to libraries. Things never change.
@graealex
@graealex Год назад
These chips obviously aren't meant to be used in conjunction with Arduinos or DIY. Rather, they help with product integration by connecting various human-machine-interface elements via a single bus to the main microcontroller, thus reducing the number of connections required, and reducing cost by integration.
@pileofstuff
@pileofstuff Год назад
There's lots of things us hobbyists use that were never intended for hobby use. That's part of the fun of it - figuring out how to use something on new ways.
@graealex
@graealex Год назад
@@pileofstuff Obviously, but for DIY I always recommend to use a microcontroller that has enough connections and processing power so you don't have to invest too much time into engineering for lack of processing power or high integration. Sometimes you see projects that use multiple Arduino Unos instead of just starting out with for example a Due that would probably be able to handle everything.
@pileofstuff
@pileofstuff Год назад
Where I see this being most useful is when you need both wifi and also a lot of GPIO. Something like remote sensor monitoring, or multi-element electromechanical displays
@graealex
@graealex Год назад
@@pileofstuff True, the dominant platform for Wi-Fi enabled microcontrollers for DIY, the ESP32, offers very little in the way of GPIOs.
@TheUnofficialMaker
@TheUnofficialMaker Год назад
of course they are
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Год назад
The chip does provide a high output, its ot design to drive much as it only provides 100uA's See 8.2.2 in the datasheet. If it was sink only they would have described the output as open drain in the same way the do for the int output. This would make a nice device to read the datasheet and work out how to drive it with out a library!
@GnuReligion
@GnuReligion Год назад
Did not take you long to figure this out. I like your high quality jump cables! After seeing some examples online, I made a game out of a PCF8574 that puts a button AND an LED on each GPIO. If polling reads are done during a small slice of time, then the off-blink (high during read) is imperceptible. So if you want to prompt a user with 8 fancy light-up buttons, it is possible. The 3d printer firmware, Marlin, has facilities to use a PCF8574 to drive displays, such as 4/5 data-wire SPI OLEDs. Extra IOs can be used to read a rotary encoder. Nifty to drive a user interface with just 2 data wires.
@danman32
@danman32 Год назад
I'd love to see an example of using this chip as an I2C to SPI converter, particularly an example that is bidirectional, that is, read and write. I have an SPI e-ink display that I'd rather address through I2C. Of course a big part of the problem is modifying the display driver to use I2C rather than SPI. Display has 3 CS, one for the display itself, one for the on-board SRAM, one for SD card reader (which can be ignored) Then there's the D/C line that controls whether you're sending the display commands or data.
@GnuReligion
@GnuReligion Год назад
@@danman32 There are endless examples of using PCF8574 to drive LCD displays, but your bespoke E-ink driver? ... Well, that might be complicated. It is probably written in C++ though. You would need to replace the MOSI/MISO/SCK refs, and it may not be possible if driver uses hardware SPI. Oh well. As long distance hiker, I always wanted an ultra low powered E-ink device to hold maps and do GPS on demand. Yeah, a doomsday prepper phone.
@danman32
@danman32 Год назад
@GnuReligion the thing is, you have to hold the CS line high or low but this chip at any time is all output or all input, so I don't see how you can read from SPI with this and still control the CS (and D/C) lines at the same time.
@pileofstuff
@pileofstuff Год назад
You can read from some pins while writing the others. With both the Arduino and MicroPython libraries. I just didn't demonstrate it very effectively.
@danman32
@danman32 Год назад
@pileofstuff I don't think you can at the same time. So if you output on say data 5, if you switch to input, you'd lose your output during the input. So if you were using one of these and selected to use pin 5 to use as CS for the SPI, when you had I2C go to read from SPI, you'd lose the CS for the SPI.
@brettb.345
@brettb.345 Год назад
There’s also a 16-bit I2C expander: MCP23017. Not sure if they’re cheap these days though.
@pileofstuff
@pileofstuff Год назад
Thanks. They look like they're $4-5 each in hobby quantities.
@GnuReligion
@GnuReligion Год назад
@@pileofstuff Yeah, I puzzle over the price of these. Pre-pandemic, it was possible to buy an ATMEGA8A for about $0.70 -- and that could be programmed act like a MCP23017.
@akhurash
@akhurash Год назад
@@GnuReligion I ended up using PIC MCU’s I had to act as IO expanders because it was cheaper than buying these IC’s. Also using an MCU as an IO expander allows more flexibility of what you have it to. For example, on one of the boards I’m using it as an output device and I can PWM the output continuously until the get another command.
@GnuReligion
@GnuReligion Год назад
@@akhurash Yup yup. Analog read and high-impedance are useful. MCUs with lots of pins are inexpensive, as well. Wonder if all those newly made 74-series, 14-pin chips aren't really are really some kind of standardish FPGA device.
@RixtronixLAB
@RixtronixLAB Год назад
Nice info, thanks for sharing it :)
@mattsadventureswithart5764
@mattsadventureswithart5764 Год назад
Makers of beer flavoured beer, yet on the back they say it tastes of toffee and caramel. A rats odour has been detected! 😂
@mrtom64
@mrtom64 Год назад
Just a heads up bit of info....there is also a PCF8574A which is exactly the same but with addresses 0x38 to 0x3F, (so you can have 128 IO). This isn't always, if ever, documented by 'sellers', is not shown as the 'A' variant on the chip, (no surprise there) and the TI datasheet for the PCF8574A confusingly and erroneously uses both ranges for the one device. The NXP and Philips datasheets for the PCF8574 are better in this respect and do document both ranges. So if you suddenly find a chip doesn't work then check if it's the 'A' variant and change the address in the code accordingly. (Use the I2C scanner to determine device addresses)
@pileofstuff
@pileofstuff Год назад
Excellent information. Thank you
@mrtom64
@mrtom64 Год назад
@@pileofstuff Excellent video, thank-you!
@surfaceten510n
@surfaceten510n Год назад
When are you going to get a beer that claims to taste like beer.😮
Далее
Adding GPIO - IO from Scratch - Part 1
20:11
Просмотров 14 тыс.
How to get Spongebob El Primo FOR FREE!
01:36
Просмотров 16 млн
1970s era home automation. Who remembers X10?
23:07
Просмотров 2,3 тыс.
Abusing addressable LEDs
13:14
Просмотров 43 тыс.
A 6809 homebrew computer
3:34
Просмотров 520
GPIO for any PC or Laptop: Adafruit FT232H
19:18
Просмотров 201 тыс.
Raspberry Pi Pico - Control the (I/O) World
1:03:16
Просмотров 608 тыс.
Open Source Analog ASIC design: Entire Process
40:11
Просмотров 42 тыс.
I2C Part 1 - Using 2 Arduinos
25:51
Просмотров 412 тыс.
relaxing kit build: Burglar alarm featuring 556 timer
22:50