Skip to main content
Topic: MSP430 Bedside Table Alarm Clock (Read 29999 times) previous topic - next topic

MSP430 Bedside Table Alarm Clock

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


Re: MSP430 Bedside Table Alarm Clock

Reply #2
Hello Markus,
Nice clock !
I am willing to make one.
Do you have the schematics and the BOM?
Thank you in advance,
Ben

Re: MSP430 Bedside Table Alarm Clock

Reply #3
Most of the stuff came from my junk box.  The 7-segment display is from ITead Studio costing just $2.00 (http://iteadstudio.com/store/index.php? ... cts_id=205).  How the shift register, the buttons, the display, the LED, the buzzer, and the debounce caps are connected to the MSP430 is described at the beginning of the source code.

Re: MSP430 Bedside Table Alarm Clock

Reply #4
Wow! So much crammed into 2K. Amazing...

Looks like your using P 1.6, and P 1.7 for double duty as well. SW1 and SW2 and speaker drive and LED is that correct?

I was thinking about using the MSP430G2452, which has 6 more I/O pins, should I be able to get by with out shift register in that case?

Thanks, great project,

Rando

Re: MSP430 Bedside Table Alarm Clock

Reply #5
Like in the original comment said: "one pin serving double as input and output when playing the alarm tune".  More precisely, P1.6 is used as input and output.  P1.7 is just an ordinary input.

Yes, you are correct.  When I was building the clock, I did not yet have the new MSP430G2452.  If you use this chip, you do not need the shift register.  Also its 8 kB of code memory should make the coding much more relaxed :)

Re: MSP430 Bedside Table Alarm Clock

Reply #6
Thank you very much Markus !
Once again, congratulations for your clock !
Ben

Re: MSP430 Bedside Table Alarm Clock

Reply #7
nice build markus

[quote author="Rando"]should I be able to get by with out shift register in that case?
[/quote]
actually even w/ the 14 pin G2211 u can omit the shift register.

here is how i had it done.

[attachment=0]

for schematic and code, etc, google "3p4w clock", i am not able to post a link here.

Re: MSP430 Bedside Table Alarm Clock

Reply #8
Yes, actually I got inspired to build my own alarm clock by your excellent 3p4w clock (http://www.simpleavr.com/msp430-projects/3p4w-clock).  It's very cool how you manage to get rid of most connection wires by placing the display directly over the MSP430.  However, as you pointed out, this way the pins for an external crystal are already occupied, and to get a more accurate time base, you added an external RTC chip (http://www.simpleavr.com/msp430-projects/rtc-clock).

For my project, I decided to not use an external RTC chip but connect a clock crystal to the MSP430 and instead add the shift register.  Nevertheless, you were first, and your projects totally rock!

Re: MSP430 Bedside Table Alarm Clock

Reply #9
thanks marcus.

i have to say that u did an excellent layout, especially like the way u had the battery holder attached to a right size board. the 3p4w clock is not practical (losing time every day) and eventually i had the rtc chip added and i am really using it everyday. i might turn to a pcb / perf board constructions like yours as it looks really good.

Re: MSP430 Bedside Table Alarm Clock

Reply #10
[quote author="Markus Gritsch"]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.[/quote]

Hi Markus, do you use any series resistors for the LED display?
Cheers,
Ian.

Re: MSP430 Bedside Table Alarm Clock

Reply #11
Of course not.  The average current is limited due to time-multiplexing the leds.

Re: MSP430 Bedside Table Alarm Clock

Reply #12
resistance is futile :X

Re: MSP430 Bedside Table Alarm Clock

Reply #13
i can't compile source is there any way to get compiled code.

Re: MSP430 Bedside Table Alarm Clock

Reply #14
I'm using CCS on Windows, and the output directory does not contain any HEX file.  There is an .out file, but I'm not sure if this of any use to you.

Has someone else here more experience with this?