STM32F103C8T6 "Bluepill" led matrix clock dcf77 clock #43
Replies: 3 comments 1 reply
-
|
I'm also working in a clock with rtc backup. But my project run on atmega328p. Rtc is connected via i2c, so I have to poll i2c bus until dcf sync. I don't like this so much: I need i2c for led matrix controller. I'd like to read rtc, init dcf77 library with this time and only use dcf77 library to keep time. When dcf77 is locked then update rtc. In this way I need to use i2c for rtc only two times, now I have to do that many times each second until dcf77 sync. Here 77,5 khz is very noisy, so sync take a very long time (a commercial radio controlled clock do the sync no more than 4 time at day). @udoklein Could it be possible to modify the library to set an initialization time or to set a time when the decoder state is free or lower? |
Beta Was this translation helpful? Give feedback.
-
|
If you have an RTC then my library is probably overkill. What I would do is to use a DS 3232 RTC (because it is cheap given the incredible prcecision is provides). Then use my library and feed it with the time from my library once the library locks to the signal. Once the RTC has the time I would reset my library and let it lock to DCF77. Once it locks to DCF77 I would do a sanitiy check vs. the RTC. That is: if RTC time roughly matches the library, then adjust the (small deviation) and increase the "trust" counter for the RTC, otherwise decrease it. Once RTC trust is above some thresshold, e.g. 10 then DCF77 must match the RTC or will be rejected. From then on DCF locks will only be used to adjust for the seconds / milliseconds. I doubt RTC is more trustworthy than a noisy DCF77 signal. This is more or less what the commercial clocks do and it is a very reasonable approach. The added value of my library is that it can get a lock even if the signal is very noisy. Nevertheless I recommend to NOT sync continuously with DCF77 because there are some very strange statistical / signal processing effects that are very hard to understand / explain. |
Beta Was this translation helpful? Give feedback.
-
|
You are absolutely right, but using TimeLib.h there is another "task" running to keep time. This is redundant. Only one task is needed to keep time. I think, my personal opinion, that a more optimized way is:
Theoretically all work, only one task keep the time and is possible to save program space, i2c bandwidth, ram and cpu cycles. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've just built a DCF77 clock based on Udo Klein's Noise resilient DCF77 decoder library for Arduino.

I used an STM32F103C8T6 "Bluepill" using the ST Microsystems STM32duino Arduino core and a led matrix display panel.
It also incorporates a home made antenna on a 200mm ferrite rod. It uses the built-in RTC of the Bluepill to shorten the start up time after any power failure or other restart.
It performs very well and is written up here: https://forum.arduino.cc/t/dcf77-led-matrix-clock-using-a-stm32-bluepill-with-built-in-backup-rtc/994599
For compatibility with the STM32duino Arduino core it has a few modifications to the library file dcf77.cpp.
Beta Was this translation helpful? Give feedback.
All reactions