my thoughts

A project log for A Very Accurate LED Clock

This clock is accurate to +/- 1 sec/month without relying on GPS or NTP synchronization. The RTC is implemented in firmware.

kc-leeK.C. Lee 05/13/2020 at 11:340 Comments

Like a lot of my projects, I try to build things with what I have and reuse/repurpose some old broken parts for different purposes. I also try out new ideas which in this case is the use of NCO for trimming the clock.  Unlike the clock on website my clock doesn't skip a second here and there.

I have been coding RTC in firmware instead of relying a chip or a module or NTP or GPS like most clock projects. NTP and its etwork hardware and IP stack doesn't come for free either.  It means less parts for me to stock, order or pay for.

I have read user comments about how inaccurate that some of the modules can be. My $0.20 microcontroller cost much less than a RTC and in most case can get close to the accuracy of the better parts after calibration. The calibration doesn't require anything other than my patience and a PC running a web browser. Since the calibration is done over a long time period, it averages out minor drifts due to temperature fluctuations etc.

A RTC module has much lower standby power consumption than firmware running on a microconroller. For my projects, I do not see the need for long duration of standby operation.

My 2nd year computer science course actually taught that as an example of a timer interrupt. Daylight saving time is implemented in my firmware. As we have seen how the politics can change the duration on a wimp rendering a hardware implementation non-functional.

I always prefer a firmware trim than a mechanical trimpot or a trimmer cap as it is far more reproducible and controllable than trying to turn a fraction of a degree assuming you know which direction with a screw driver.  Thankfully some of the RTC chips and RTC peripherals on some of the microcontroller such as the STM32F030 are incorporating a trim register.