Skip to main content
Topic: MSP430 LED Matrix Toy (Read 30480 times) previous topic - next topic

MSP430 LED Matrix Toy


I just did a quick little project using an MSP430 and two 595 shift registers to drive a small LED matrix display, suitable for beginners.  Two push buttons are used as inputs and a buzzer is connected to a timer output to generate some tones.  A resistor to pull up the reset line, a clock quarz to keep track of the time and a buffer capacitor for good measure are all the additional parts needed.


The board dimensions were chosen to match the size of a 2 AA battery holder.  Four M2 nuts were forced into the perf board at appropriate positions under the ICs.


Although only very few parts are used, there were some 50+ connection wires on the bread board.  By using thin wire from an old relay, everything fits nicely between the board and the battery holder.


Re: MSP430 LED Matrix Toy

Reply #1
The example firmware scrolls a short message smoothly across the display when pressing a button and puts the board in sleep mode afterwards.  In sleep mode the power consumption is about 2 µA, so 2000 mAh AA batteries would theoretically last 100+ years :)

Re: MSP430 LED Matrix Toy

Reply #2
Great project, thanks for posting it. I like the idea of recycling the copper wire from an old relay coil :)

Re: MSP430 LED Matrix Toy

Reply #3
Hey Nice project, the point to point construction really shrinks down those jumper connections compared to the breadboard setup.

I noticed in the code as part of your brightness matching scheme you use the inline delay_cycle routine would it not be more efficient to use a capture module of the timer so the CPU can be sleeping during a delay. I know that the current consumption of the LEDs when they are lit would far surpass the CPU's consumption but every little bit helps. Just my $0.02

Are you planing to do anything else with it? Maybe an RTC with an alarm :P

Re: MSP430 LED Matrix Toy

Reply #4
> but every little bit helps.

Of course there are many ways the firmware could be written, but as you already pointed out, saving on the MCU current while having the LEDs suck 30+ mA is really not worth the more difficult approach.

I have not yet decided what to use this little platform for.  Since I already built an MSP430 based bedside table alarm clock [1], I would rather like it to become something else :)

[1] viewtopic.php?f=56&t=2126

Re: MSP430 LED Matrix Toy

Reply #5
noob questions again :o).
why choose this MCU, why not choose one from the LCD serie ?
the lcd serie seems pretty nice, with onboard hardware mux etc etc...
i didnt check price or other things yet ...

but it is a nice little board you made for sure  :o)

Re: MSP430 LED Matrix Toy

Reply #6
Good question.  The answer simply is because I had the parts lying around :)  And because PDIP packages are so darn easy to solder.

Re: MSP430 LED Matrix Toy

Reply #7

I decided to make an alarm clock out of this little project.  Here is what it looks like:

First I cut the battery holder at the bottom to give the clock an angled standing position:

The remaining single battery compartment holds a 700 mAh AA sized LiFePO4 battery.  The cell voltage of 3.2 V is perfect for this application.

I also changed the schematic a tiny bit and added a white LED to the buzzer pin.  In the dark it can be used as a handy flashlight.

The firmware from my previous alarm clock [1] was adapted.  Please find it attached to this post.  Due to the larger flash memory size of 8 kB of the MSP430G2452, the wake-up tune is a bit more sophisticated. (Taken from the SHizZLE demo [2] starting at about 1:15.)

In standby mode the clock draws about 2.6 uA.  Displaying the time consumes about 18 mA (auto power-off after 4 seconds), using it as a flashlight by having the white LED turned on also draws about 18 mA (auto power-off after 1 minute).

The rechargeable LiFePO4 battery I used is rated having 700 mAh @ 3.2 V.  Doing the math gives the following theoretical values:

Standby: 30 years
constant on flashlight/displaying time: 43 hours

I guess the real limit is the self discharge of the battery, but LiFePO4 batteries perform quite well in this respect.

So I expect a few years of regular usage before I have to recharge it :)

A short video of the alarm clock in action is available on YouTube:

Have fun,

[1] viewtopic.php?f=56&t=2126

Re: MSP430 LED Matrix Toy

Reply #8
awesome as usual.
good job

Re: MSP430 LED Matrix Toy

Reply #9
Thanks! :)

Re: MSP430 LED Matrix Toy

Reply #10
An interesting device and I would be building my own if I had the parts handy. But while looking at the code I noticed a few things.

There is a comment that claims that this will run down to 2.4V. This contradicts the MSP430 data sheet which shows that it will not run at 16MHz below 3.3V. Setting the DCO to 8MHz would allow safe operation down to 2.4V.

Re: MSP430 LED Matrix Toy

Reply #11

I'd love to build one of those with a ATmega328P. Any chance the code can be ported?

Re: MSP430 LED Matrix Toy

Reply #12
@UhClem: Good catch!  When testing I just lowered the supply voltage of my power supply and looked at which voltage it won't start anymore.  I will make another test using the 8 MHz calibrated oscillator frequency.

Re: MSP430 LED Matrix Toy

Reply #13
I did some measurements and got the following results:

16 MHz -- the device stops working at 2.4 V,
12 MHz -- it works down to 2.1 V, too little voltage for the white LED to turn on,
8 MHz -- stops working at 1.8 V, matrix LEDs are quite dim,
1 MHz -- works at least down to 1.5 V, below that the LEDs are completely dark.

I think I will stay with 16 MHz to prevent discharging the LiFePO4 cell too much and risk loss of capacity.  This way I'm forced to recharge it at 2.4 V.  The white LED also only works above this voltage.

Re: MSP430 LED Matrix Toy

Reply #14
What temperature range did you test over? If you will never ever operate it outside of narrow room temperature limits then this isn't important.

As for using the failure to operate below 2.4V as a stick to get you to charge the battery, why not add a low battery warning? There is an ADC just sitting there begging to be used. You will want to keep it powered down most of the time of course.