Hi,
like everyone else, I finally built an alarm clock for my bedside table using an MSP430 which came with the TI Launchpad.
To get hold of the low pin count, I used a 74HC164 shift register for port expansion. Thus two pins of the MSP430 are used as shift register clock and data yielding eight outputs for the anodes of the 7-segment (plus decimal point) digits.
Another four pins of the MSP430 are used to time-multiplex the four common-cathode digits, using a variable time per digit depending on the LED count, the digit is using. This is done to get the digits equally bright.
The remaining two pins of the MSP430 are connected to push buttons for user interaction -- one pin serving double as input and output when playing the alarm tune.
A simple finite state machine is used for the control logic. I found the available 2048 bytes of program memory a bit sparse, needing to rewrite code sometimes to get a lower memory footprint. The program plus the data for the tune now use even the last available byte.
In normal standby operation the circuit consumes about 2 µA -- yielding a theoretical lifespan of 10+ years assuming the 200 mAh AAA batteries won't die beforehand :)
The source code is attached below and a video can be found here:
http://www.youtube.com/watch?v=a6q4vUfasKw
Have fun,
Markus



