thejpster / monotron

A simple 8-bit home computer style application for the TI Tiva-C Launchpad
Apache License 2.0
191 stars 9 forks source link

Dual Genesis/MegaDrive pad support #59

Open thejpster opened 5 years ago

thejpster commented 5 years ago

I've concluded we need two joystick inputs, so we can have two player games. It would also be good to support MegaDrive pads (mainly as I have two of those anyway).

A MegaDrive pad has 6 active-low output pins, and a 5V input select signal, giving a total of 12 possible outputs from the pad. These are Up, Down, NC, NC, A, Start, Up, Down, Left, Right, B, C.

We currently have five inputs for the Joystick, plus two unused pins. We have no pins free on the Atmega (actually we have minus 1 free pins). Using an MCP23S17 we can handle the 12 inputs, and two select outputs using our existing I2C bus interface, freeing up 5 I/O pins (one of which is an active-low button on the Launchpad anyway).

Or we could upgrade the Atmega to a 40-pin device.

thejpster commented 5 years ago

We could also use a nifty dual header.

https://www.digikey.co.uk/product-detail/en/amphenol-icc-commercial-products/L17H2110130/L17H2110130-ND/4884779

image

thejpster commented 5 years ago

The SPI version of the chip might be faster than the i2c version.