Among the junk in my box are a handful of RTC modules scavenged from old PCs. They are the DS1287 and DS12887 from Dallas Semiconductor which are basically the Motorola MC146818 with a 32.768 kHz crystal and coin cell attached and encapsulated in a tall 24 pin DIP package.
Of course the coin cell drained long ago, so I applied this rework hack (with a hacksaw too, you can see the notches in the photo above) to disconnect the cell. I had incorporated a socket for this RTC in my 8048 board and written firmware for it. You see a section of the board in the photo above. The idea was that if I powered the RTC module with an external battery it could maintain time without power. This was not successful. Only some of the RTC modules could be made to work, and not very reliably, even when powered by the same 5V supply as the 8048 microcontroller.
Finally with curiosity killing me I decided to get to the bottom of matter. I wrote an Arduino sketch to initialise the RTC (basically the same sketch I used to test the freestanding MC146818s I had) and then read the time registers. I also enabled the SQW (square wave) output of the chip and attached a scope to that output.
What I discovered was that only a few of the modules I had could keep updating the time registers and also provide a 32 Hz square wave output. A few couldn't update the registers but could supply the SQW.
So I tossed out 2 modules that couldn't even generate a SQW, obviously the crystal oscillator or MC146818 inside were bust. For the remaining ones I modified the board and firmware a little to use the SQW as a pseudo-mains timebase, and set the clock going. The 2 DS12887s and 1 of the 3 DS1287s were a bit erratic, and sporadically stopped oscillating. That left only 2 usable DS1287s. But they kept pretty good time only a few seconds out per week, considering they are an old generation of RTCs, whereas the current generation has temperature and ageing compensation. This may be because they are running indoors where the temperature only varies a couple of °C around 24°C.
So I now know that I have 2 usable modules for my boards. The rest I can send to e-waste heaven.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.