Minimalist's Clock? Multi-mode Clock? Matrix Clock?
Minimalist Multi-mode Matrix Clock
This is a multi-mode clock project based on the msp430g2432. It can be assembled with minimal parts. With limited 8x8 pixels display resolution, this 12 hour clock shows time in 6 different modes. This project is based on a older attiny 2313 project I did a few years ago.
HHMM mode, typical hours plus minutes scrolling digits with colon separator.
Seconds mode, shows only seconds.
Tix mode (shown below), led matrix is divided into quadrant, the upper quadrants shows the hour in bcd (binary coded decimal) values. they are represented by the number of dots to indicate the digits. the lower quadrants show the minute in bcd. i.e. for 5:34 it shows no dot + 5 dots on the upper half and 3 dots + 4 dots on the lower half.
Dice mode (shown below), the led matrix is divided into two set of 'dices'. with the upper pair showing hour from 1 - 12, the lower pair of dice shows minutes in 5 minute increments. i.e. for 5:45 it shows dice value upper 5 + lower 9 (5 hour, 9 x 5 min).
Binary (really it's bcd, or binary coded decimal) mode, (shown below) the hour, minute and second digits are show as binary dot on different columns in the led matrix. the columns 0 and 1 (from left) represents the hour digits, column 2 is blanked, columns 3 and 4 represent the minute digits, colum 5 is blanked, columns 6 and 7 represents the second digits.
The circuit employs row and column multiplexing to drive the leds, one row at a time, this gives a 12.5% duty cycle when "sets" of leds (8 of them in each of the 8 rows) are turn on briefly. current limiting resistors are eliminated to save breadboard estate and as we are not constantly driving individual leds, they are not going to be damaged.
The control (user interface) is also arranged so that we only use one tactile button for input. the firmware capture long button presses (press and hold) for menu rotation and normal button presses for menu selection.
By migrating this project from an AVR mcu to a msp430 mcu I had made it possible to keep time a lot more accurately. During display (i.e. led on) the project runs at 1Mhz DCO. The msp430 mcu has factory calibrated clock values. When not displaying, this project enters a LPM3 (low-power mode 3) to conserve power. At LPM3 the DCO clock cannot be used and the project switches to use a 32Khz crystal based AClk to keep time.
- Minimal component count, 4 parts.
- Battery operated from 3V to 3.6V.
- Use of watchdog timer to keep time, power-down sleep mode (LPM3) takes uA power.
- 32Khz crystal to keep accurate time when sleep.
- Runs 1Mhz DCO calibrated clock when active (displaying time).
- This is a 12H clock, not 24H and has no AM/PM indicator.
- Easter egg application.
- msp430g2432 (or other G series dip 20pin devices w/ 4k+ flash)
- 8x8 LED matrix display (red only, this is a 3V project)
- tactile button
- 32Khz clock crystal
- 2x LR44 button cell or 3V-3.6V other battery source
- Short key press in display mode cycles through HHMM, seconds, tix, dice, binary and sleep modes.
- Long press enters setup mode, subsequent long press rotates thru menu.
- Menu items cycles thru 'Set Clock', 'Dimmer', 'Auto-off'.
- In 'Set Clock' setup mode, short presses increment digit values (hours, minutes) and long press confirms.
- In 'Dimmer' setup mode, short presses cycles through available brightness levels, long press confirms setting.
- In 'Auto-off' setup mode, short presses toggle the auto-off on and off. With auto-off turned on, the clock displays time for 15 seconds and turn itself into LPM3 sleep mode to converse power. With auto-off turned off, display is on continuously.
- When in sleep mode, MCU goes in power down mode, consuming less than 30uA of power, 32Khz crystal w/ watchdog timer is used to keep time. A pin interrupt is enabled to allow for wake up via tactile button. In this mode the main clock is disabled to conserve power.
- Led segment multiplexing includes time delays to compensate for brightness differences for individual rows.
the 8x8 led matrix has dot size of 1.9mm and is of common cathode, if you have common anode type, you can change a few lines in the code for adoption. see the following diagram and see if you have the right pin-outs. it appears they are quite common and if you purchase via ebay most suppliers have the same pin-out even if the model number is different.
| . . +-------------------(1)------------(1) . . |
| . . | . . . o||o (2)------------------+. . | (crystal)
| . ./ | . . \. +--+--+--+--+--+--+--+ . |. . |
| . (+) | . . o C7 C6 R1 C0 R3 C5 C3 R0 . |. . | (2xLR44 cell)
| . .\ | . . /. | b2 b3 | . |. . |
| . (+) | +--+--+--+--+--+--+--+--+--+ |. . |
| | | |G b6 b7 T R a7 a6 b5 b4 b3|| |
| | | | || | (msp430 mcu)
| | | |+ a0 a1 a2 a3 a4 a5 b0 b1 b2|| |
| . | (1) . . .+--+--+--+--+--+--+--+--+--+ |. . |
| . +----------(+) +--+--+--+--+--+--+--+ (2)+. . | (8x8 red led matrix)
| . . . . . . R4 R6 C1 C2 R7 C4 R5 R2 . . . |
| . . . . . . . . . . . . . . . . . |
| . . (1)-[ ]-(+) . . . . . . . . . . . | (tactile button)
| . . . . . . . . . . . . . . . . . |
*note: all (1)s, (2)s and (+) points are electrically connected
| | ROW5 <--|P2.0 P1.0|--> ROW4 (of LED Matrix)
/|\ | | ROW2 <--|P2.1 P1.1|--> ROW6
| _|_ | --- ROW1 <--|P2.2 P1.2|--> COL1
--o o------ COL0 <--|P2.3 P1.3|--> COL2
Button ROW0 <--|P2.4 P1.4|--> ROW7
COL3 <--|P2.5 P1.5|--> COL4
32Khz /-- COL7 <--|P2.6(XIN) P1.6|--> COL5
Crystal \-- COL6 <--|P2.7(XOUT) P1.7|--> ROW3
- Follow breadboard layout and place two jumper wires on mini breadboard
- Place msp430g2432 mcu
- Place 32Khz crystal
- Place Tactile Button
- Place power source (I am using 2xLR44 w/ magnets as holders)
- Finally place 8x8 led matrix on top of msp430g2432