Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By sfranzyshen
#80083
Barnabybear wrote:Hi, not that I know of. The MCP23017 is a much better choice for more outputs and does have interupts.


the MCP23017 is an over priced solution to a simple problem ...

MCP23017 $1.24
74HC165 $0.40

way faster than any (bitbang) i2c expansion board ... way cheaper than any i2c expansion board ... and way more scale(able) ... and easier to code too! :roll:
User avatar
By buzzy
#80084
sfranzyshen wrote:
Barnabybear wrote:Hi, not that I know of. The MCP23017 is a much better choice for more outputs and does have interupts.


the MCP23017 is an over priced solution to a simple problem ...

MCP23017 $1.24
74HC165 $0.40

way faster than any (bitbang) i2c expansion board ... way cheaper than any i2c expansion board ... and way more scale(able) ... and easier to code too! :roll:


I actually ended up with an even cheaper solution, the CD4051BE. It can be used for both input and output and cost $0.07 USD :) Super easy to understand and work with. I basically trade 3 digital PINs for 8 analog ones. Totally worth it.

https://www.aliexpress.com/item/100PCS- ... 4c4dTqCKo8
User avatar
By sfranzyshen
#80085
buzzy wrote:I am using a 74HC595 to get more pins on my esp8266. With the "normal" pins of the esp8266, I usually use interrupts to be notified of changes to pin status. Is there a way to do this with the extra pins I get of the SPI interface? Thanks!


So as I pointed out earlier ... using the 74HC165 is a better choice for extra inputs ... but never gave an answer about using them with SPI AND Interrupts together ... I personally feel with the speed available polling the register with every loop or using a software interrupt or even a millis() variable and then comparing the last read with the current read to determine if a button was pressed works best ... eliminating the need for the extra gpio. However, I include it here as a demonstration of using SPI & hardware interrupts together ...

Schematic
Image

Code: Select allcoming soon...
User avatar
By sfranzyshen
#80087
buzzy wrote:I actually ended up with an even cheaper solution, the CD4051BE. It can be used for both input and output and cost $0.07 USD :) Super easy to understand and work with. I basically trade 3 digital PINs for 8 analog ones. Totally worth it.

https://www.aliexpress.com/item/100PCS- ... 4c4dTqCKo8


the problem with multiplexers are they don't scale ... for application specific use the CD4051BE is a great choice ... but what if your application requires 128 or 256 inputs ... BTW the $0.40 quoted for the 74HC165 is from mouser for a single piece ... if I go to aliexpress for 100 of the 74HC165 they are $0.03 USD :) BOOM!

https://www.aliexpress.com/item/100PCS- ... st=ae803_5