We have a problem in our house. The youngest has a habit of waking the whole house at a time that is not pleasing to the rest of us. We put a clock in his room, but that didn’t help much because the monster child can’t read yet.8 comments
As with everything I decided a technological solution MUST be the best, so I present, the funky clock.
The dual colour LED array is from Sparkfun. It is driven using two 74595 chips for the columns and a pair of ULQ2003 chips for the rows (because I didn’t have a ULM2008 chip). The brain of the thing is a PIC18F4550 running my native code compiling forth which I control over USB. I plan to produce a screen cast showing this in action at some stage.
I wanted to make the whole thing fit behind the display, so I was forced to put the processor and the LED driver hardware on their own boards.
The top of the processor board.
The bottom of the processor board.
The LED driver board. I was really pleased with this one. The 74595s are positioned so that they line up with the correct pins on the LED matrix so I didn’t need to run as many wires. This meant that I had to rotate one of them 180 .
The bottom of the LED driver board.
The power board plugs into the processor board using the same connector as the PICkit 3.
All four parts of the clock fit together nicely
I’ve set it up to display the hour in the main display area. Blink the bottom left LED every second to let me know it is working, and display the minute in binary on the bottom row. When it is bed time the hour is displayed in red, and when it is time to get up the hour is green.
I doubt it will make any difference, but I had fun making the funky clock
It is amazing how easy it is to develop on the thing using forth on the actual hardware.
It was so much fun making a forth from scratch. It is based very loosely on jonesforth in that it implements many of the same kernel words, however it differs in that it generates subroutine threaded code instead of being token threaded. I have also implemented a very simple co-operative task switcher. The above task is responsible for setting up the display. I have two other tasks running, one that drives the LEDs and another that updates the time. While these tasks are running I am also still able to interact with the forth system via the virtual serial port over USB.
I want to thank my Dad again for all his help with the hardware.