Hardware - electronics

The guts of the thing

The core hardware for the Game-o-Tron 3000 is a Teensy 3.1 which provides an ARM Cortex M4 processor running at 72Mhz with 64K of RAM and 256K of flash for programs and static data. This is connected to an ILI9325 LCD screen on a Adafruit breakout board (the 9328 version also works) which is connected to the Teensy via a parallel interface. The screen also has resistive touchscreen which is connected and supported in the software but not used in any of the current games.

The screen supports 18bit colour but is used here in 16bit mode. As the parallel interface is 8bits wide, two transfers are needed for each pixel. The Teensy pins used for the 8bit interface were chosen so that they made up the lower 8bits of GPIO port D. In this way a read or write can be done in a single instruction instead of having to set bits in different ports.

Push the button

As well as being used for the screen, these 8 pins also connect to the switches used to control the device. Each switch is connected between one of the "bus" pins and the "button common" pin with a diode in series. To read the buttons, the button common pin is set to an output and driven high. The "data bus" is then read and any high bits indicate pressed buttons. When reading or writing to the screen, the button common is set to an input. The diodes prevent shorting across the pins when using the screen if two or more buttons are pressed.

Bleeps and bloops

Audio output is generated using the Teensy's analogue out (A14) pin and fed to an Adafruit 2.8W amplifier breakout board. Although this is a stereo amplifier, only one channel is used to drive a single 2mm mylar speaker. The shutdown pin for the other channel is used to turn it off, reducing power consumption a tiny bit.

Power!

Power is supplied either via the USB connector at the bottom or from 4 1.5V AAA cells in the top half of the case. The position of the power switch determines whether the unit is powered via USB, or switched off if there is no USB supply or via the batteries. When batteries are used a 5V step up/down regulator provides the required voltage and the low battery LED is controlled by a small circuit built based around a 741 op-amp. This might not be the best solution and the low battery LED will flicker a bit when supply voltage reaches the turn-on level (about 3V) but the limitation here was my electronics ability and at least I can say that I did use some discrete components and not just plug modules together.

Putting it all together

Components and connectors were mounted on stripboard and the low battery circuit was also build this way. PCB header pins were soldered to the various "modules" (Teensy, screen, audio amplifier etc.) and connected to PCB header sockets mounted on stripboard which were then wired together. For the Teensy, as it has no mounting holes this provided the physical mounting as well as the electrical connection. The exceptions to this were the switches behind the control buttons. These had wires attached and were mounted in 3D printed parts. This proved to be fiddlier than I thought it would be and if building another I would use a different technique, or at least redesign the part holding the switches. The associated diodes were mounted on a separate piece of stripboard.

Where things go

The components were arranged as follows: top front screen and low battery LED with the Teensy and the batteries behind them. In the bottom half, the control buttons, power switch and speaker at the front with the switch diodes and the audio amplifier bottom left and right (looking at it from the back). Attached to the bottom of the case are the voltage regulator, the USB socket and the low battery circuit.

Schematics