Programming the LED Matrix

Now that I’ve got the LED matrix wired up and working it’s time to share the code I used to make it all work. It’s really quite simple and doesn’t take much code at all. That’s the beauty of using an LED controller over trying to directly control them manually with shift registers or I/O expanders. Continue reading “Programming the LED Matrix”

Pinball LED Matrix Prototype

After trial and error, I have successfully created an LED matrix prototype using a Maxim MAX6958 four digit segment display driver. Normally these drivers are used with 7-segment displays, up to four, with a few extra LEDs to display information. A good example is the typical alarm clock you may have next to your bed. I’m using it to drive 36 discrete LEDs which will light up the inserts in my playfield and other features. Continue reading “Pinball LED Matrix Prototype”

Double Setbacks

This has been a disappointing week for Project Pinball. Following the success of getting the audio up and running, I moved onto working on the switch matrix. It didn’t work. I then tried to breadboard up an LED matrix using an IC specially designed for the task. It didn’t work. Ugh.

So what went wrong? For the switch matrix, it’s actually not too big of a deal. Usually, these are wired into rows and columns of switches which allows a small number of I/O to read many switches. For what I have wired up, it’s a 4×4 matrix. That means for 4 inputs and 4 outputs, I can read 16 switches. For the actual pinball machine, I’ll double the I/O for an 8×8 matrix which is a much larger 64 switches. I will create a complete write-up of exactly how it works once I get it actually working! In a nutshell, my mistake was I accidentally soldered the rows and columns identically. It will be an easy fix, but I need some solder wick to re-work the board which I have on order.

Learning my lesson, I decided to breadboard up the LED matrix instead of soldering it in case I make another stupid error. I’m using a MAX6958 to drive the matrix. Its main application is actually for driving four 7-segment displays, plus their decimal points and 4 more discrete LEDs. A 7-segment display is really just 7 individual (8 with the decimal point) LEDs sharing a common anode or cathode. The MAX6958 is setup for common cathode displays. It can also be used to drive up to 36 discrete LEDs which is how I intended to use it.

Prototype LED Matrix and Switch Matrix
Prototype LED Matrix and Switch Matrix

The beauty of this chip is it drives the LEDs through a method called charlieplexing. To keep it simple, charlieplexing simply means that only a single LED is lit at a time, but they’re switched so fast that the human eye can’t tell and they all look illuminated at the same time. If you had a high-speed camera, you could see each LED flash in sequence. This has the advantage of using very little power. Only ~23 mA at any given time.

I actually got this all wired up correctly the first time, which is quite the feat. It took a lot of head scratching, but I was amazed I didn’t have any errors. You can imagine my disappointment when it didn’t work. It partially works. I am able to walk a pattern down each “digit” with one LED on at a time (one LED per row in the photo) but as soon as I try to do more than 1 per row, problems arise. With 2 LEDs they’ll work, but after a few seconds will stop. If I do more than 2, they flash momentarily then go dead.

With some troubleshooting, I discovered that the device was entering shutdown mode. I double checked all wiring and found no errors, it’s definitely a problem with the MAX6958. Some google searching didn’t give me much to go on. All I found was a reference that someone had problems when using 3.3V LEDs and it describes my situation almost exactly. I have a support ticket in with Maxim support, but I suspect these chips are not capable of driving higher voltage LEDs despite the datasheet not giving any limits at all on the LEDs used.

The forum post I found said they added resistors to the common cathode paths, so we’ll see how that goes.