SparkFun will be closed on Monday for Memorial Day (5/27). Orders placed after 2pm MT on Friday (5/24) will process and ship out on Tuesday (5/28).
65 microcontrollers, 4096 LED's, and a secondhand coffee table bring new light to an old-school video game.
Chris Taylor - Power board, hardware, coding
Casey Haskell - Mechanical Design, coffee table refurbishing
David Wolpoff - Original concept, router design
Nathan Seidle - Idea factory
This project is the game of pong with a new twist and an interesting implementation. The original idea for this project was to design a coffee table to have integrated LEDs. We'd seen designs with interactive LEDs that responded to objects on the table, and they usually had around 400 LEDs...so we decided to up the ante with 10 times as many. We built the table and then decided that simple interactions were not enough, and went to work on a full-fledged game. 4-way multiplayer pong, in fact. Being geeks, we were obligated to have the game controlled using 4 Atari 2600 controllers (circa 1977).
The table itself was bought secondhand and refinished. Then it was retrofitted with proper mounting for the big LED matrix. The individual LED matrices were mounted on a custom plastic frame. All this work was done by resident mechanical engineer and lady-killer Casey Haskell. The matrices are connected 8 to a row, all 8 rows controlled via a custom router board connected to an Olimex LPC2106 development board. The entire rig is powered by a hacked 500 watt CPU power supply.
The Rest is Just Details:
The LED Matrices:
Each LED matrix consists of two parts, the actual LED module composed of 64 RGB LED's in a plastic mounting, and a Sparkfun RGB matrix controller board. The controller board hardware works using shift registers and SPI communication. The firmware maintains an 8x8 array of color values. When a new value comes in on the Data In line, it is shifted into the first "spot" in the array. The 64th value (the last "spot") is sent out on the Data Out line. This allows the matrices to be strung together in series to create a large matrix of color values that shift simultaneously. More on this later. You can find the schematic and code on the controller product page.
The tabletop-sized matrix:
Our first goal was to get the 64 matrices into "tabletop" size. We designed a custom mounting board and hacked the table itself such that each matrix could be bolted on and removed individually. The mounting board has holes that allow access to the power and serial lines of each matrix. We decided that the table would be controlled row-by-row, each row consisting of eight matrices. The data for each row would be clocked into the first matrix, and that data would then be clocked down the row. We originally directly connected the DATA OUT line of the first matrix to the DATA IN line of the second matrix and from the second to the third, all the way down the row. This posed a problem, however, because when clocking in data at the speed needed to display a pong game, noise on the lines would cause errors in the data, and we would end up with incorrect colors displaying on the board. Our solution was a custom buffer and power board.
This board simply consists of a decoupling capacitor at each input to each matrix, and a buffer refreshing the data signal before each matrix. This got rid of our errors and made the refresh a lot cleaner. For the geeks, take a look at the power board schematic.
The wiring for the table was wonderfully complicated-looking, but fortunately it looks worse than it really is. We used Olimex serial programmer cables that connected one-to-one to the power board. Here's a shot of the under-side of the table top after final assembly:
Stay in control:
The entire matrix is controlled with a single SPI line from an Olimex LPC2106 development board. Earlier I said that the big matrix was set up as a set of 8 separately controlled rows. Eight rows, one SPI line? Answer: router board.
The router board is essentially a glorified chip select, with three of the port pins on the 2106 board reserved for a three-bit chip select. The router simply drops the chip select of an entire row, and sends the data out for the entire row, with the rest of the rows ignoring the data. The rows are refreshed one at a time, from the top to the bottom of the matrix. Router Schematic
The Atari controllers were simply hardwired to port pins on the controller board. The controllers are simply polled on each cycle, with the bar position updated every cycle. The schematic for the joystick was found here.
The actual game code is your standard game of pong, with modifications to accommodate the unusual display. The code maintains a 64x64 matrix of color values (simple char values for speed). On each iteration of the game loop, the code updates the paddles and the ball, and then refreshes the screen. Simple enough? Yes. Too simple? We thought so. So in order to add a new twist to the game, we implemented a "multiball" version of pong. In this version, the idea is to make the game team-based. Each time the ball hits one of the paddles, a score in the center increases. After every 10 "hits" another ball is added. The idea is for the team of four to stay alive as long as possible. This was accomplished in code by holding an array of multiple balls, the number of active elements in the array increasing as the hit count increases. As soon as a ball is missed, the game is over and the team's score flashes on the screen. Of all the teams that played at Makerfaire in San Fransisco, the high score was 67 (about 7 balls). Our game code can be downloaded here.