Initial Arduino driver perfboard circuit:
Once I had one module working with the Arduino, I quickly decided the Arduino wasn’t very nice to look at. I decided I would go for a minimalist layout, with just the atmega, using its internal oscillator and talking to a dedicated battery-backed RTC. The ATmega would use its internal 8MHz oscillator so I programmed the fuses to that effect. The next step was to ditch the arduino bootloader (which didn’t work well with the internal oscillator) and get a real AVR programmer, which i did on ebay for the measly sum of $4.
After soldering 3 large modules to the Arduino (note the data bus on top) Small modules not installed yet
I then did the same for the smaller 2 display modules, with a slightly different chip enable configuration. With this I managed to address all 20 characters individually. Debugging a layout with that many wires was not easy, given that they are all on the same bus, so one thing going wrong in the bus means either they all fail, or only some chips work (if the failure is in a chip or digit select line or a bad solder joint/short). Add to it that the displays show nothing if the data is invalid, it was tricky to know what went wrong.
Making sure all the characters are all usable
I first had it running keeping rough time using the ATmega’s internal 8MHz oscillator, but it would drift extremely quickly, as is expected of a “+/-2% RC oscillator”. Still it was nice to finally see the displays doing something semi-useful by themselves after all those years in the parts bucket.
Showing (very drifty) time for the first time! Now let's switch to words.
This is when I received my two DS1307 RTC modules from ebay. First, I dutifully let the smoke out of the first one by swapping power and ground wires. Happy that I had ordered two of them, i proceeded with the other. The strange part is the battery arrived installed in the RTC already, and they had square wave output turned on, which drained the battery much faster for no reason! I promptly turned it off. Mounting it to the breadboard was a bit annoying, since I wanted it in the back, but with the battery slot accessible. I ended up using some of the pins as standoffs, and some double sided tape. I don’t need it to be too sturdy anyway.
I made good use of Akafugu’s i2c RTC library for talking to the RTC, setting and querying the time. The read functions populates a simple struct that the program can then access. I use a big array of strings to represent text, that I read directly from the actual hour/minute value.
During development I was powering this contraption from my computer’s usb port through the tinyusb isp programmer, which worked wonderfully. Once I switched to a usb charger brick as a power source, I started having some really strange issues. It would suddenly stop refreshing the displayed time, and I would have to unplug and plug it back in, and it would work well for another few hours. I was told that bad power could cause lockups of the chip, so I sourced some caps to add filtering and smoothing between VCC and ground (an electrolytic and a ceramic cap, like most of the Atmel design notes prescribe).
This is what the board looks after I mounted the RTC and the filter caps.
It’s a bit messy: I used 30AWG single strand wire that I soldered using a fine metcal tip and tweezers. The fancy automatic stripper tool I got earlier proved to be very useful and enjoyable to use, stripping multiple wires at one with the same length.
My best friend during this project.
The extremely poor quality of the breadboard I used did not help, with pads lifting way too easily if a bit too much heat...
Read more »