In one of my projects I am using an sx1505 8-bit i/o expander to scan a key matrix.
It has some neat features: two independent i/o voltages, pull-up/down, configurable interrupts, and PLD functions.
Of course after ordering parts I realize there is a better chip with built-in matrix scanning, debounce, and LED PWM… the sx1508:
It’s not completely superior as you lose PLD functionality, and the cost is a few cents more.
I was going to just order it and swap it out, but for some reason they aren’t pin compatible (see SLC pin4 > pin3 below). Should be an easy mod, but still seems like an odd design choice.
Anyway, the main reason for this post was to upload the code I used: sx1505.zip
I’ve only tested basic I/O, not interrupt or PLD yet. i2c driver is from atmel AVR1308.















