↑ Return to Matrix Medallion

Circuit Diagram and Source Code

I use a USBTinyISP from LadyAda.net. It works just fine, however you need an adapter to connect the 6×1 connector on the Matrix Medallion to the 3×2 pin connector on the USBTinyISP. The pin-out on the Matrix Medallion is (from the middle to the edge) Gnd, Reset, MOSI, SCK, Vdd, MISO.

All source code is written for WinAVR C compiler.

The sample code uses a double-buffer technique. An interrupt driven display routine cycles through the bits in the current buffer and displays them on the LEDs, one LED at a time. Remember, if you try to display more than a few LEDs at once, you’ll probably draw too much power from the battery and cause the processor to reset.

While the interrupt routine is displaying the current buffer, your main loop should be slowly populating the new buffer. Once you’ve completed the new buffer, clear the BufStat flag and wait until it gets set again indicating that the interrupt routine has switched buffers and you can begin populating the new buffer again. Pretty simple.

The fastest frame rate you can achieve is however long it takes to cycle through all 49 LEDs as the new buffer won’t be activated until the end of the scan. Your main routine can take whatever time it needs to calculate the next buffer, the display routine will continue to redisplay the current frame until the new buffer is ready. Try your hand at writing your own displays. Post the results in the Forum!!

Note that the Scrolling Text program makes use of a 4×7 font matrix. You can use the included 4x7font.xls to modify / create your own font characters. Just change the location of the ‘*’s in rows 6-12 and then cut-n-paste rows 18-24 into the source code. If you just want to make your own text string, change the bytes in the Src[] string to be the bytes for the necessary characters. Recompile and burn and you should be good to go.

Matrix Medallion Circuit

Matrix Medallion Circuit

Scrolling Text source
Conway’s Life source
Bouncing Ball source