RTuinOS: DCF77 decoder task, re-usable, self-contained, easy to integrate

Dear Arduino Fans,

we present a demo application for RTuinOS: A re-usable, self-contained
DCF77 task. DCF decoding as such is nothing new, you'll find many hits for
DCF77 and Arduino in the net; the added value of this sample is the
demonstration how easy and elegant such a decoder can be encapsulated when
using an RTOS. A functional interface decouples the DCF task from actual
I/O operations; it's safe and easy to integrate the task into various
applications that deal with time information. The additional task
increases the mean CPU load by only 1%.

The DCF task is distributed with a tiny test and development application,
which does nothing else than running the DCF task and printing the results
to the Arduino Serial Monitor. This sample application is called dcf77.

Secondary, the archive contains a modified copy of RTuinOS' test case
tc14. Among more, this test case implements a real time clock. The DCF
task is added to this sample in order to synchronize the real time clock
with the DCF time information. The modified test case is called tc14_dcf.

Please inspect tc14_dcf to find out how simple it is to integrate the
re-usable, self-contained DCF task. Consider to use a diff tool to find
the changes between the original and the modified sample.

The samples do of course require an external DCF receiver connected to the
Arduino board. Such a receiver can be purchased in the net for a few
Euros. The pin which the receiver's (digital) output signal is connected
to and the polarity of this signal are compile time constants in the
sample code. Please refer to the code documentation in the C file headers
for details, particularly tc14_dcf/tc14_adcInput.cpp.

Both sample applications can be compiled with RTuinOS 1.0. Unzip the
archive into the folder /code/applications of your
RTuinOS installation and open a shell window. CD to the root directory
, where GNUmakefile is located. Run make like:

make -s build APP=dcf77
make -s build APP=tc14_dcf

make -s upload APP=dcf77
make -s upload APP=tc14_dcf

The make target "upload" must be used only if the Arduino board is
connected. Maybe you have to specify the USB port on the command line,
please refer to the RTuinOS User Guide.

The code can directly be run on an ATmega 2560 board. Other boards might
need modifications, please refer to the RTuinOS User Guide.

Forum members, who are logged in, can download the archive of the DCF
decoder task directly from this topic; everybody can find it at

For forum members RTuinOS 1.0 is available at
RTuinOS 1.0: Second Release of the Real Time Operating System (RTOS) for Arduino - Libraries - Arduino Forum; everybody can find it in
GitHub at GitHub - PeterVranken/RTuinOS: RTuinOS, a small Real Time Operating System (RTOS) for Arduino and at
GitHub - sudar/RTuinOS: RTuinOS, a small Real Time Operating System (RTOS) for Arduino.

Kind regards

Peter Vranken

RTuinOS-1.0.2-dcf77Task.zip (73.2 KB)