MSP430 Bedside Table Alarm Clock

A place to document your own projects.

MSP430 Bedside Table Alarm Clock

Postby Markus Gritsch » Sun Apr 03, 2011 11:59 am

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
Attachments
source.zip
(6.02 KiB) Downloaded 1802 times
IMG_0708.jpg
IMG_0709.jpg
tune_narrow.png
Last edited by Markus Gritsch on Fri Apr 22, 2011 2:40 pm, edited 1 time in total.
User avatar
Markus Gritsch
Sr. Member
Sr. Member
 
Posts: 271
Joined: Tue Feb 09, 2010 6:54 am

Re: MSP430 Bedside Table Alarm Clock

Postby arhi » Sun Apr 03, 2011 5:37 pm

nice use of that small msp :)
User avatar
arhi
Hero Member
Hero Member
 
Posts: 2109
Joined: Thu Jun 24, 2010 11:41 am
Location: Belgrade, Serbia

Re: MSP430 Bedside Table Alarm Clock

Postby Benj87fr » Mon Apr 04, 2011 1:49 pm

Hello Markus,
Nice clock !
I am willing to make one.
Do you have the schematics and the BOM?
Thank you in advance,
Ben
Benj87fr
Newbie
Newbie
 
Posts: 2
Joined: Mon Apr 04, 2011 1:46 pm

Re: MSP430 Bedside Table Alarm Clock

Postby Markus Gritsch » Mon Apr 04, 2011 2:19 pm

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.
Attachments
main.pdf
(33.3 KiB) Downloaded 1272 times
schematic.png
User avatar
Markus Gritsch
Sr. Member
Sr. Member
 
Posts: 271
Joined: Tue Feb 09, 2010 6:54 am

Re: MSP430 Bedside Table Alarm Clock

Postby Rando » Mon Apr 04, 2011 2:37 pm

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
Rando
Newbie
Newbie
 
Posts: 2
Joined: Mon Apr 04, 2011 2:32 pm

Re: MSP430 Bedside Table Alarm Clock

Postby Markus Gritsch » Mon Apr 04, 2011 2:49 pm

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 :)
User avatar
Markus Gritsch
Sr. Member
Sr. Member
 
Posts: 271
Joined: Tue Feb 09, 2010 6:54 am

Re: MSP430 Bedside Table Alarm Clock

Postby Benj87fr » Mon Apr 04, 2011 3:46 pm

Thank you very much Markus !
Once again, congratulations for your clock !
Ben
Benj87fr
Newbie
Newbie
 
Posts: 2
Joined: Mon Apr 04, 2011 1:46 pm

Re: MSP430 Bedside Table Alarm Clock

Postby simpleavr » Mon Apr 04, 2011 8:07 pm

nice build markus

Rando wrote:should I be able to get by with out shift register in that case?

actually even w/ the 14 pin G2211 u can omit the shift register.

here is how i had it done.

3pc01.jpg
3p4w clock


for schematic and code, etc, google "3p4w clock", i am not able to post a link here.
simpleavr
Newbie
Newbie
 
Posts: 5
Joined: Mon Apr 04, 2011 7:34 pm

Re: MSP430 Bedside Table Alarm Clock

Postby Markus Gritsch » Tue Apr 05, 2011 3:16 am

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!
User avatar
Markus Gritsch
Sr. Member
Sr. Member
 
Posts: 271
Joined: Tue Feb 09, 2010 6:54 am

Re: MSP430 Bedside Table Alarm Clock

Postby simpleavr » Tue Apr 05, 2011 7:22 am

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.
simpleavr
Newbie
Newbie
 
Posts: 5
Joined: Mon Apr 04, 2011 7:34 pm

Re: MSP430 Bedside Table Alarm Clock

Postby 2lostkiwis » Thu Jun 23, 2011 4:29 am

Markus Gritsch wrote: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.


Hi Markus, do you use any series resistors for the LED display?
Cheers,
Ian.
2lostkiwis
Newbie
Newbie
 
Posts: 7
Joined: Thu Jan 14, 2010 7:05 am

Re: MSP430 Bedside Table Alarm Clock

Postby Markus Gritsch » Thu Jun 23, 2011 7:10 am

Of course not. The average current is limited due to time-multiplexing the leds.
User avatar
Markus Gritsch
Sr. Member
Sr. Member
 
Posts: 271
Joined: Tue Feb 09, 2010 6:54 am

Re: MSP430 Bedside Table Alarm Clock

Postby Sjaak » Thu Jun 23, 2011 8:20 am

resistance is futile :X
User avatar
Sjaak
Fellow
Fellow
 
Posts: 3039
Joined: Sun Jan 03, 2010 2:45 pm
Location: Hiero

Re: MSP430 Bedside Table Alarm Clock

Postby jdegl » Sat Jul 02, 2011 7:56 pm

i can't compile source is there any way to get compiled code.
jdegl
Newbie
Newbie
 
Posts: 2
Joined: Sat Jul 02, 2011 12:41 pm

Re: MSP430 Bedside Table Alarm Clock

Postby Markus Gritsch » Sun Jul 03, 2011 2:32 am

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?
User avatar
Markus Gritsch
Sr. Member
Sr. Member
 
Posts: 271
Joined: Tue Feb 09, 2010 6:54 am

Next

Return to Project logs