Shop OBEX P1 Docs P2 Docs Learn Events
Here's a simple and cheap 8 way DIP switch on I2C — Parallax Forums

Here's a simple and cheap 8 way DIP switch on I2C

I try to avoid DIP switches as much as I can but in this project I think I must use them since I have so many identical modules all bussed together. But I was a bit pressed for I/O and of course I could use the equivalent of a PCF8574 but decided I had one I/O to spare anyway so I used a cheap 74HC165 parallel-in/serial-out shift register. By connecting the Prop's I2C SCL to the clock and the SDA to the load it will of course chatter wildly during any I2C operation but who cares as the Prop isn't listening.

When I do want to read it I just simulate the load pulse, read it and clock it until I'm done with the SDA line held high so it looks like start/stop conditions although it is probably too fast too be seen by an I2C chip.

I may still end up with an I2C I/O expander but in any case this is it. The colored pullups are simply parts of resistor networks. The TSSOP16 74HC165 costs less than 10 cents in reel quantities, the resnets about a cent each so the interface circuit costs around 12 cents.

1279 x 796 - 66K

Comments

Sign In or Register to comment.