How this came about

When I originally designed 8048 board, I envisaged using the DS1287/DS12887 RTC modules I had scavenged. As explained in a tale of DS1287s this didn't work out and I found that I had only 2 usable RTC modules that could provide a clock timebase.

Looking at the CD4060 clock divider chip which I had used in older projects, I realised that could be used to divide down the MCU clock to a suitable frequency in the tens of Hz, and then firmware could count this to keep time.

Wait, why not use the MCU to do the division?

This is only possible if a timer in the MCU supports a hardware auto-reload mode where the counter is reloaded on overflow or underflow. The 8048 timer doesn't support such a mode, while most modern MCUs do. When the counter overflows or underflows, there is a delay while the ISR reloads the counter. Though measured in microseconds it causes cumulative slip in keeping time. Thus this hardware solution.

The circuit

It's nothing novel, just a CD4060 in standard configuration, with the addition of a crystal and a few other components. A resistor and NPN transistor provide an open-collector clock output. We need this because the CMOS output can only drive one LSTTL load. There is a solder jumper to allow an external clock to substitute for the crystal, and set of solder jumpers allow choosing one of the divider outputs. The CD4060 divides up to 2^14. Up to 1.5 MHz can be accepted by the CD4060; it's rather slow CMOS technology.

In use

As you can see from the photo, the board is designed to fit the socket of the DS1287/DS12887 and is just a bit larger than a 24-pin DIP package. 4 pins connect the board to the mother board, power, clock in, and clock out. It could also be used free-standing with 4 wires to the base board. For the 8048, the ALE output provides a CLK/15 frequency. Since I'm using a 4.915200 MHz crystal, this results in a divider input of 327,680 Hz. If I take the output frequency from the 2^13 tap, this gives a time keeping frequency of 40 Hz and the firmware is configured for that. Timekeeping accuracy is ultimately dependent on the MCU crystal. It should be possible to only require adjustment every few weeks or so. A throwback to the days when people adjusted their clocks to a noonday gun or the pips just before radio news.

With the tiny size of this board, I had it panelised. Not only is this necessary for production, but also gets me more boards than I'll be able to use up. PCBWay charged me a bit extra for the V-cuts but I had enough gift credit to cover that.

So, rather old technology and not novel but feel free to reuse bits of the design you find useful.