Cheap LED I2C-controlled display from an old clock.
Turning an old clock display into a very basic sort of video card.
I'm not sure how much this will help anyone, but it does show the ability of fritzing to help document a complicated breadboard. The programs might interest anyone who wants to try a similar trick.
I wanted to do some LCD programming, but I was low on cash, and then, in the depths of a cupboard, I found an ancient digital alarm clock. It hadn't worked for years, and it had a digital display on it, so I decided to use it.
After freeing the LED clock display from the inside of the clock, cleaning off the ridiculously thick layer of flux and soldering on some pins, I found that it didn't seem to have any part numbers or anything on it, so I was forced to figure out how it worked myself.
The image "clock LED display" gives an idea of just how weird it was. The first three pins turned out to be the LED cathodes, and the rest are shared anodes. The main caveat is that none of the cathodes light up a whole digit.
Furthermore the fifteen pins it needs leave only a few pins left free for programming as one likes.
The first problem, however, was actually displaying numbers on the display. Since the cathode has to be swapped in order to display different halves of each digit, I opted to use the Atmega's two timer interrupts to perform PWM on the display's pins. For example, if I wanted to display "142", the program would figure out how much time to spend in each state and set the interrupt timers accordingly. (code : new_driver.c, new_driver.h)
Once that worked, I decided to make it into a self-contained system, controlled by the 2-wire serial interface (essentially I2C). This way, I could potentially have several of chips telling it what to display, and I could keep a breadboard with the whole set-up ready to go.
The file test.c shows the current (slightly hacky) code for the controller chip in my own set up here. The mastering code is essentially copied from the Atmega168 manual, with added error-detection to allow for the chips' potentially different start-up times, for example.
Created on September 6, 2010, 02:38