MX030 - Radio Clock with DCF77

Forum to discuss articles which have been published in Matrix Multimedia's article zone. If you have any comments or questions regarding the articles please post them here.

Moderators: Benj, Mods

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

MX030 - Radio Clock with DCF77

Post by Spanish_dude »

Article: https://www.matrixtsl.com/resources/get ... php?id=526

If you have any questions for the author or comments on the article, please post them below.
Last edited by Spanish_dude on Thu Sep 30, 2010 7:54 pm, edited 3 times in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Radio Clock with DCF77

Post by Benj »

Hello Spanish dude,

Brilliant article, i will be having a play with this when I next get some free time as I've always wondered how this worked. I wonder if its possible to make the AM receiver by hand using a simple LC resonater circuit or if you have to go down the route of the pre-made receiver module to ensure accuracy.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hi,

Thx Benj :)

I found this pdf (see page 3) : http://arvin.schnell-web.net/dcf77/dcf77.pdf (source : http://arvin.schnell-web.net/dcf77/ )

You just need to connect the LC antenna, but I recommend you to just buy one of those receivers; it's easier, it works great and maybe cheaper than doing it yourself.
If I remember well, my DCF77 receiver module was about 15€ (I bought it 2 years ago and still works great).

Rgds,

Nicolas L. F.

PS : I made a radio clock using the 16x2 LCD E-Block, but the code is like 2 years old. I'm going to clean it and post it when I have some spare time ;).
P - PS: I forgot to mention it in the arcticle but a DCF77 radio clock is GMT +1 ^^.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hey ,

Sorry for double posting, but here you have the flowcode file, C file and HEX file for the DCF radio clock using the 16x2 LCD display E-Block.

As said in my previous post the code was like 2 years old so I programmed it again (it's based on the one in the article).

Time is displayed like :

Code: Select all

HH:MM:SS        X 
DD/MM/YYYY   ZZ
X is either 'H' or 'L' (High pulse, Low pulse indicator).
ZZ are the first 2 letters of the day of the week (like "mo" for monday).

Btw, I added a screen of the DCF77 receivers' output in the article.
Attachments
DCFClock.hex
HEX file
(8.76 KiB) Downloaded 1228 times
DCFClock.c
C file
(19.29 KiB) Downloaded 1353 times
DCFClock.fcf
Flowcode file
(22 KiB) Downloaded 1569 times

Harry Tuttle
Posts: 27
Joined: Sat Aug 01, 2009 3:15 pm
Has thanked: 2 times
Been thanked: 10 times

Re: Radio Clock with DCF77

Post by Harry Tuttle »

Hi Nicolas,

Thanks for taking time to post your article, it was interesting to look at your code.

best regards,
Harry

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hi,

Thanks for the comment Harry !

Rgds,

Nicolas Lopez F.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hi everyone,

Just found a little bug in my fcf program. It's the LCD that doesn't always work.
What you need to do is increase the delay at the top of the program. I used a 1s delay, works like a charm :mrgreen: .

See ya.

Nicolas L. F.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hey,

A couple days ago, I made a video about the project.
Or on youtube : http://www.youtube.com/watch?v=qNsx_SFm ... rofilepage

Btw, don't forget to enable the youtube annotations !

Enjoy ;)

Nicolas Lopez F.
Last edited by Spanish_dude on Mon May 23, 2011 9:32 pm, edited 1 time in total.

Jan Middel
Posts: 7
Joined: Sun Nov 18, 2007 11:23 am

Re: Radio Clock with DCF77

Post by Jan Middel »

Hello,

Nice program ,
But when i run the program i get as time 45:85:seconds.
The date is 45/10/2165...
Wath can be the problem???

Jan

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hello Jan,

It looks like a synchronisation problem with the 59st second.
Could you post your flowcode file and maybe a screen of your DCF output (to see whether it's TTL or not) ?

I'll take a look at it and see if I can find a problem.
If not, it could be an hardware issue.
Have you set the correct oscillator in flowcode and in your hardware ?

Rgds,

Nicolas L. F.

Jan Middel
Posts: 7
Joined: Sun Nov 18, 2007 11:23 am

Re: Radio Clock with DCF77

Post by Jan Middel »

Hi,

Thanks for the RePay,
Go look at it.
Let know the outcome

Jan

Albert van Bemmelen
Posts: 1
Joined: Sat May 15, 2010 7:22 am

Re: Radio Clock with DCF77

Post by Albert van Bemmelen »

Dear readers,

I also have made already in 2007 a DCF77 receiver with a Pic with 3 time zones.

It was written in FC 3 and published in Elektor December 2007 (www.elektor.nl).
There you will also find a DCF 77 generator and other stuff.

Greetz,
Albert van Bemmelen, Weert, The Netherlands.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hi Albert van Bemmelen,

I think I used your program as example for my DCF77 project (GIP) at school 2 years ago.
It was really useful, thanks :).

Rgds,

Nicolas L. F.

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times

Re: Radio Clock with DCF77

Post by MJU »

People @Matrix told me this article already existed, I had already made my own Flow to use DCF77.
I didn't really look at Spanish_dude's code, but here is mine.

My goal was to implement a "radio controlled" clock in an existing project with as less possible code.
My approach is to use the TMRO overflow to time everything in the DCF signal.
I divide the Internal Clock 1:256 so the macro is called every 1/75th of a second.

I measure three things
1- the time the signal is low
2- the moment of the rising edge of the high signal
3- the time the signal is high

With this I can use all features of this protocol.

1- If the signal is low for more than 1 second this means that there was no high pulse (that signals the start of every minute).
This is also the start of the sending of the databits. I can synchronise the data with finding the absence of a secondpulse.
2- The rising edge of the signal means that there is data following and a new second started.
3- If the signal is high for 100ms, this means the received bit was zero, if the length of the pulse is high more than 200ms this means a "one".

If the signal is low, I start measuring how long. If this is longer than 75 cycles the macro is called, this means that this is the beginning of a new minute.
If this happens I look how long the timer was used during the previous high pulse and calculate the time and or date (which I need).
If the signal was low, but is high now, I start measuring how many times the macro is called without going to zero.
If the signal was high and is still high, the counter is increased.

It's quite a simple way to implement the DCF signal in an existing project, without a slight delay for the update for the LCD, I never use delays.
This makes it simple to use the approach in existing projects without causing too many delays.

The DCF77 is a very slow process so the controller has time enough to do other stuff.

The datasheet for the DCF77 reciever module states that there is no use for a pull up resistor, but without this I got some short pulses on the input so the synchronisation was lost.
You can still see this in the Flow because I measure the time the signal is high within a range.
If the signal is to short time high, this is not used. If it's high to long, this isn't use either because the sync is lost.

When the project is first started you get weird readings, this comes because there is no synchronisation with the clock.
After the first minute, things become beter, and after two whole minutes you should get a perfect reading.
I use a variable "found", this is 1 when the controller detects the absence of a secondpulse, if you want you can use this variable to count a few minutes without further action.
If you count three "founds", you can be sure the clock is synchronised (if the hardware works)..

Enjoy this small contribution.
Attachments
DCF77_eng.fcf
English version of the Flow, which shows date, time and weekday on an LCD
(23.03 KiB) Downloaded 1281 times

lawrenceh
Posts: 3
Joined: Tue Apr 05, 2011 8:44 pm

Re: Radio Clock with DCF77

Post by lawrenceh »

Hi

I hope my question has been posted in the correct forum. Please bare with me.

A long time ago, I built an MSF60 clock, using a 6502 processor. This receives the time from Rugby in the UK. I now live in near Karlsruhe in Germany and have found this old self made clock and tried to use it but it doesn't work. I think I am now too far, 1000km from Rugby.

Before I exchange the receiver for a DCF77 receiver, my question is, do the MSF60 and DCF77 transmitters transmit compatible data formats? I don't think they do. If not, has anyone written a PIC processor based conversion program to convert the different signal formats in real time, so I can continue to use my old clock?

Many thanks in advance.

Lawrence

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: Radio Clock with DCF77

Post by JohnCrow »

Hi Lawrence

I also believe the two formats are not compatible with each other. (There are several time signals over the world and all use different protocols)

Had a quick look on the internet and found quite a bit of information
This being one article

http://www.compuphase.com/mp3/h0420_timecode.htm

This has started my interest in building a DCF clock myself sometime, looking for information on a supplier for a receiver module at the moment.
Anyone know a supplier in the UK?
1 in 10 people understand binary, the other one doesn't !

lawrenceh
Posts: 3
Joined: Tue Apr 05, 2011 8:44 pm

Re: Radio Clock with DCF77

Post by lawrenceh »

Hi John

I thought as much. Yes I had a look at the web site your suggested. Everyone seems to rate the Conrad DCF77 receiver,
http://www.conrad.de/ce/de/product/6411 ... -dokumente

I am back in the UK in mid May and can bring one with me if you don't have any success.

So the question is, can anyone point me in the direction of a program for a PIC16F628, which would read the DCF77 signal on one port, convert it and transmit it on another port? If not, I will be taking a crash course in JAL programming :-)

Many thanks in advance.

Lawrence

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Convert it to what ? MSF60 protocol ?

That would be possible, but I haven't much time to do that right now.

lawrenceh
Posts: 3
Joined: Tue Apr 05, 2011 8:44 pm

Re: Radio Clock with DCF77

Post by lawrenceh »

Hi

Yes to convert the DCF77 signal protocol to the MSF60 format. If you do get the chance, I would be very grateful. Otherwise I will have a look at using a high-level language.

Many thanks

Lawrence

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Radio Clock with DCF77

Post by Jan Lichtenbelt »

Dear Nicolas,

I have the same problem as Jan Middel, after start up the reading of the LCD screen is:
45:85:14 L
45/25/2161 su
The seconds reading is very irregular.

Do you have already a solution?

Thansk a lot

Jan Lichtenbelt

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Hi,

Have you made any modification to the program ?

Try changing the input of the DCF signal to a non analog input (even though the analog pins are disabled).

kevinvh
Posts: 2
Joined: Sun May 22, 2011 10:11 pm
Been thanked: 1 time

Re: Radio Clock with DCF77

Post by kevinvh »

Hi,

For my GIP (project for school) i must made a datalogger.
It must save the temperature and the measuring time.
but i can't find to get the right time with my DCF-module.
I tried your prog but i got the wrong time.
I gaves 15:15:xx
15:15:2015 su
This is just your prog without the sensor, just the DCF-module is connect.
For this project i must use a PIC16F690.

I hope that you can help me with that problem.

Many thanks in advance
kevinvh

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Radio Clock with DCF77

Post by Spanish_dude »

Try MJU's program.
You are not the first one that have had problems with this program even thought it's working when I try it :/

kevinvh
Posts: 2
Joined: Sun May 22, 2011 10:11 pm
Been thanked: 1 time

Re: Radio Clock with DCF77

Post by kevinvh »

Hi

Can someone help me pls with my program for the DCF.
I have tried many times but i failed every time.
I tried your prog and adjust it to my project but i doesn't work.
I use a PIC16F690 with a external oscillator from 20 000 Hz.
The DCF is connect at RA2.

Thanks in advance

Kevin

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: MX030 - Radio Clock with DCF77

Post by JohnCrow »

Hi Nicolas

Been looking at your article for a while and Ive now located a source for the modules in the UK
Very cheap too, £6.95.
Ive bought both the DCF and the MSF versions.

I was amazed at how tiny the module is, even after looking at the data sheet prior to ordering.

Once I get the DCF working using your program, I'll see if I can convert it to work with the UK standard.

I do have a couple of obervations though.
The modules are very cheap, but do need a quite complex program to read them.

A GPS module is quite a bit more expensive but, using flowcode the same type of data and accuracy can be obtained very easily.
But these modules look very interesting.

Wonder if we will get an e-block and flowcode macro for one of these
(Dont worry Steve only joking :lol: )
1 in 10 people understand binary, the other one doesn't !

Post Reply