Close

How to interface all those buttons!

A project log for BabyBaby or Extremely Small Experimental Computer

An FPGA implementation of the Manchester Baby or Small Scale Experimental Computer.

davedave 01/17/2016 at 17:580 Comments

Whilst there are enough inputs on the Spartan3E chip to interface all the switches, on the Nexys 2 board many are only accessible via a "HiRose" connector. Given the small spacing of the pins on this connector, it really needs a PCB to access the connections, and an extra PCB didn't fit with my project aims.

I already had a 16-Switch interface that I had obtained for an IBM1130 FPGA implementation, which uses the MCP23S17 SPI I/O chip, to allow 16 switches to be read via a 4-pin interface. I also had some VHDL that would initialize the chip as a 16-line input device and then continually read the state of 16 switches.

However for the Baby Baby "Typewriter" buttons I needed 32 inputs. Whilst multiple SPI chips can be cascaded on a single interface, doing so usually requires an extra Chip Select line for each cascaded chip. However the MCP23S17 has a nice additional feature. Each chip can have an address set via three address lines. I used this feature to interface the 32 typewriter buttons to the FPGA.

You can see the circuit I used here:-

https://cdn.hackaday.io/files/8912381291008/switches - Schematic.pdf

As you can see its very simple and I just knocked it up on a bit of prototype board. The "pull Down" resistors are mounted on the back of the push button switches. I used a third MCP23S17 to input the L-Stat and F-Stat switches, along with the Manual/Auto, Display Highlight and Read/Write switches. The MCP23S17 chip for these switches was mounted on the same prototype board. So I now had a lot of connections. I needed to make a proper frame and mount all these....

Discussions