| Crates.io | rp-rs-radio-clock |
| lib.rs | rp-rs-radio-clock |
| version | 1.1.0 |
| created_at | 2022-06-27 20:57:30.927543+00 |
| updated_at | 2025-03-08 21:43:08.952298+00 |
| description | DCF77 and MSF receiver on a Raspberry Pi Pico |
| homepage | |
| repository | https://codeberg.org/rene0/rp-rs-radio-clock |
| max_upload_size | |
| id | 614320 |
| size | 58,829 |
This is a receiver for both the German DCF77 and British MSF time transmitters. Wikipedia has detailed information on both stations. Reception of the two stations happens independently of each other. If reception allows, the clock displays the current dates and times as broadcast by the two transmitters after a few minutes.
Refer to the schematic for the various components.
This work is licensed under MIT OR Apache 2.0 Copyright 2022-2025 René Ladan rene0+codeberg@freedom.nl
To build the program, you will need a recent version of Rust (the code is generally developed on the latest release version of Rust) with the thumbv6m-none-eabi target installed as this is what the Raspberry Pico runs. After compilation, load the compiled program on your Raspberry Pico, after which the program should start.
The group of three LEDs (connected to pins 12-14 is used by DCF77:
The group of four LEDs (connected to pins 2-5) is used by MSF:
When powering on the clock, LEDs 12 and 14 are on until the first pulse of DCF77 is received, and LEDs 2 and 5 are on until the first pulse of MSF is received.
The push button of the KY040 switches between showing local time and UTC. The display of DCF77 and MSF are switched simultaneously. Some indicators might show up during the remainder of the minute because the state of those indicators is re-evaluated live, in the same way as re-evaluating them upon a new minute.
The rotary encoder of the KY040 is currently unused, but it might be used in the future.
The display is divided in two parts, with DCF77 using the top two lines and MSF using the bottom two lines:
DCF77 cbaymdwhmt =MS
YYMMDD WW HHmmSS TCL
MSF dcbaymdwhmt =D!
YYMMDD WW HHmmSS Tdd
The station names are displayed on the top lines. Normally the first letter of the station name is in uppercase, but it switches to lowercase if the current minute was overflowing and next minute was predicted by the software itself instead of being decoded from the transmitter. After the station name, various characters can show up in case the software detected an anomaly.
The first three ('cba' for DCF77) or four ('dcba' for MSF) letters appear in case of a parity error. These letters are in lowercase if the parity could not be calculated and in uppercase if the calculation succeeded but mismatched the expected value.
The next seven characters (same for DCF77 and MSF) appear if a value (e.g. month) jumped unexpectedly:
The last three characters on the lines with the station name indicate miscellaneous things:
DCF77 cbaymdwhmt =MS
YYMMDD WW HHmmSS TCL
MSF dcbaymdwhmt = !
YYMMDD WW HHmmSS Tdd
The second and fourth line show the current date and time. All numerical values are two digits long and optionally preceded by a '0', and show up as '**' if they could not be decoded.
The last three characters show miscellaneous aspects: