DCF77 Radio Clock
In this example a decoder for the DCF77 standard-frequency radio signal is presented. The transmitter is located nearby Frankfurt in Germany and continuously transmits a 77.5 kHz signal that encodes the local time using amplitude and phase modulation. The sender is controlled by the high-precision atomic clocks of the German institute of standards (Physikalische Bundesanstalt in Braunschweig). The signal can be received almost everywhere in central Europe with very simple and cheap receivers. A short description about the motivation and the encoding of the DCF-77 signal can be found here and here.
Task of the state-machine
The DCF-77 modulation reduces the signal amplitude for 0.1 seconds (short pulse, 0-bit) or 0.2 seconds (long pulse, 1-bit) at the beginning of each second, allowing to transmit 1 bit of data per second. A simple BCD-encoding scheme is used to transmit the hours, minutes, days, and data information for the next following minute. To allow synchronization into the signal, no pulse is send during the 59th second, so that the start of the next pulse exactly marks the beginning of the minute. The following state machine decodes the received pulses and calles setClock() if the clock/date information was successfully received.
The software runs on a MSP430-1232 evaluation board and can be compiled with the IAR KickStart Editon for MSP430. The CPU is normally in low power mode and wakes up about every 5ms triggered from a timer interrupt. Within this timer interrupt the pulse width is measured. If a pulse was detected the state machine is called with event evTick. If the pulse length does not fit the defined limits an evTimingError event is sent. At the end setClock() gets called e.g. to display the time/date on a LCD display.
The complete source code and model file is part of the Sinelabore demo download.