How to expand inputs and outputs using MCP23S17

Manufacturers P/N: MCP23S17
Cost: $1.65 from
Description: 16-bit I/O expander w/ Serial Interface
Datasheet: MCP23S17

Sometimes using small microcontroller chips (to save money!) offers a limited number of inputs and outputs. Especially when using the Picaxe family of chips, the inputs and outputs are sometimes just not enough. There is an unfortunate event that happens with the Picaxe 08, 08M, 14M, 20M, 18, 18A, 28A chips: not enough GOSUBs are allowed. The Picaxe 18X, 28X family, and 40X family has the memory and GOSUBs available to handle this expansion. This tutorial uses sub procedures for the serial communications. The X1 and X2 parts have SHIFTOUT and SHIFTIN capabilities that saves a lot of memory. I have done some experimenting, and I have taken a poorly written program (143 bytes) to a better one (123 bytes). This information is provided, but the actual example program will demonstrate a little more and will be much larger.
Continue reading

Digital Clock Archive: Old clock photos

This is an archive of the original digital clock photos. The new clock has many improvements over the last one. It is much simpler to make as well, but does not include the alarms. The program that I had posted for the clocks also had errors that made it function in weird ways. As always, if you have problems, please post a comment to our site, and we will be happy to help.
Continue reading