Multiplexed LED screen project

JohnR66

Flashlight Enthusiast
Joined
Aug 1, 2007
Messages
1,052
Location
SW Ohio
I always wanted to make one of these. I keep it "real" by figuring out how to design and program the project without any outside help, although the concept is nothing new (think calculators and hand-held games developed starting in the 70's).

The problem. The micro controller has only 8 output pins, but I need it to control 15 or more LEDs to display numbers, characters, or even motion display.

The solution is to multiplex the output pins so more LEDs can be used.

How it works: The screen is made by making a grid of horizontal and vertical wires with a LED bridging each intersection. Each column is turned on and back off in sequence with the appropriate row(s) turned on to make the pattern for the displayed character. (Technically, the column is on when it is low (0 bit) so the LED is on when its row is 1) The scanning happens so fast that it seems like several LEDs are on to create the number letter or graphic.

The programming.
I wrote the program so that I could change the displayed graphics without having to rewrite the thing much. Just new data added.

First, I have to define the shape of the characters to display. For example the letter "A" or number "1" dot patterns must be defined and stored in memory.

Second, There is an area in memory called the "frame buffer" where the character or graphics pattern is placed so that so that the next part of the program reads the buffer and puts it on to the screen.

Third, As stated, the buffer is read one column at a time and output to the screen. This scanning or mutliplexing section of code loops fast so the display seems solid. You can see the strobing effect if you turn your head quickly. You might have noticed this on LED or fluorescent displays.

The program loops and advances a counter to grab the next character to display.

The program I have running counts through the hexadecimal code 0-9, A-F. It is set up using a 3x5 LED grid. The program is only 192 bytes long and most of that is defining the characters. The frame buffer and multiplexing routines are only about 25 lines of code total.

Expanding. To make a larger display, say 20 columns x 6 rows for scrolling messages, I would use a shift register on one output pin and clock out a bit for the columns and increase the size of the frame buffer accordingly.

Okay, well I'm nerdy and just wanted to show how this is done, or at least how I did it. I hope to play some more with these ever fun microcontollers.

matrixled.jpg
 
Wow! That is really cool. Here I thought I was the only person in the world who thought those were really sweet!

I´ve ofthen thought about making one for scroll text to put in the cars rear window to signal to annoying drivers: "self cencorship " or " Biiip biib biip bip bibbety bib you nasty biiib!"

Great build. Are you taking it anny further than its current state??
 
Top