Minimalist's Clock? Multi-mode Clock? Matrix Clock?
This is a multi-mode clock project based on the MSP430G2432. It can be assembled without soldering and minimum use of tools. With limited 8x8 pixels display resolution, this 12 hour clock shows time in 6 different modes. It employs minimal components (only 5 to 7 parts) and minimal wiring (4 wires). The whole project including battery is housed in a 1.5" x 2" breadboard. Bonus easter egg "Tetris" like game, see last project steps.
- Minimal component count, 5 parts.
- Minimal wiring, only 4 wires required.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 of Tetris game.
Step 1: HHMM Mode
HHMM mode, typical hours plus minutes scrolling digits with colon separator. Photo below is not clear as the digits are scrolling.
Step 2: Seconds Mode
Seconds mode, shows only seconds
Step 3: Tix Mode
Tix mode, 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 4:32 it shows no dot + 4 dots on the upper half and 3 dots + 2 dots on the lower half.
Step 4: Dice Mode
Dice mode, 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. Upon every seconds the dice will rotate between possible values. For example, the 4th hour can be represented by 0 + 4, 1 + 3, and 2 + 2 combinations of 1 or 2 dices. Below, for 4:32 it shows dice value upper 4 + lower 6 (5 + 1), works out to be 4 hour, 6 x 5 = 30 min, with the odd 2 minute truncated as we only represent values of 5 minute increments.
Step 5: Digits Mode
Digits mode, a small 3x3 condensed font is used to display both hour and minute without the need of scrolling the digits. The minutes digits shifts left and right on the second and the hour digit (when in the hour of 1 to 9) slides from right to left to indicate every 10 seconds advancement during the minute. 4:33 and about 30+ seconds are show in the photo.
Step 6: Binary Mode
Binary mode (really it's bcd, or binary coded decimal), 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, column 5 is blanked, columns 6 and 7 represents the second digits. Below representing the time of 4:34:16.
Step 7: How It Works
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.
Step 8: Components / Parts
- MSP430G2432 (or other G series dip 20pin devices w/ 4k+ flash)
- 8x8 LED matrix display (red only, this is a 3V project)
- tactile button, you need 3 if you want the Tetris game enabled
- 32Khz clock crystal
- CR2032 or other 3V battery source
Step 9: Breadboard Layout
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 attached photos and 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.
Step 10: Schematic / Assembling
- 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 CR2032 button cell)
- Finally place 8x8 led matrix on top of MSP430G2432
Source code and firmware for the project can be downloaded from my github repository, files needed are mclock.c (source) and M-Clock.hex (firmware binary)
Step 11: Easter Egg / Tetris Like Game
With extra flash space on the MCU, I am able to squeeze in a Tetris like game. This easter egg application is eanbled by placing the additional / optional tactile buttons in the right breadboard positions.
Pressing either game (left or right) buttons when the clock is showing will start the game. Game control is via the left and right buttons to move the game piece horizontally, and the clock button, in the game mode, will acts as the game piece rotation button. There is no speed drop in this implementation. When game ends (game pieces stacked up to the ceiling), the score (number of rows eliminated) will be shown briefly as 2 flashing digits.