Page 1 of 2

MX030 - Radio Clock with DCF77

Posted: Mon Sep 27, 2010 10:25 pm
by Spanish_dude
Article: http://www.matrixmultimedia.com/article.php?a=505

If you have any questions for the author or comments on the article, please post them below.

Re: Radio Clock with DCF77

Posted: Tue Sep 28, 2010 11:32 am
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.

Re: Radio Clock with DCF77

Posted: Wed Sep 29, 2010 2:42 pm
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 ^^.

Re: Radio Clock with DCF77

Posted: Thu Sep 30, 2010 8:26 pm
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.

Re: Radio Clock with DCF77

Posted: Fri Oct 01, 2010 7:30 pm
by Harry Tuttle
Hi Nicolas,

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

best regards,
Harry

Re: Radio Clock with DCF77

Posted: Mon Oct 04, 2010 6:39 pm
by Spanish_dude
Hi,

Thanks for the comment Harry !

Rgds,

Nicolas Lopez F.

Re: Radio Clock with DCF77

Posted: Sat Oct 09, 2010 4:37 pm
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.

Re: Radio Clock with DCF77

Posted: Fri Nov 05, 2010 1:09 am
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.

Re: Radio Clock with DCF77

Posted: Sun Dec 05, 2010 1:22 pm
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

Re: Radio Clock with DCF77

Posted: Sun Dec 05, 2010 5:38 pm
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.

Re: Radio Clock with DCF77

Posted: Mon Dec 06, 2010 5:20 pm
by Jan Middel
Hi,

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

Jan

Re: Radio Clock with DCF77

Posted: Wed Dec 08, 2010 11:51 am
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.

Re: Radio Clock with DCF77

Posted: Thu Dec 09, 2010 12:19 am
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.

Re: Radio Clock with DCF77

Posted: Mon Mar 28, 2011 5:53 pm
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.

Re: Radio Clock with DCF77

Posted: Wed Apr 06, 2011 7:11 pm
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

Re: Radio Clock with DCF77

Posted: Wed Apr 06, 2011 7:38 pm
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?

Re: Radio Clock with DCF77

Posted: Thu Apr 07, 2011 7:15 pm
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

Re: Radio Clock with DCF77

Posted: Fri Apr 08, 2011 1:26 pm
by Spanish_dude
Convert it to what ? MSF60 protocol ?

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

Re: Radio Clock with DCF77

Posted: Fri Apr 08, 2011 7:06 pm
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

Re: Radio Clock with DCF77

Posted: Wed Apr 13, 2011 2:15 pm
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

Re: Radio Clock with DCF77

Posted: Wed Apr 13, 2011 5:37 pm
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).

Re: Radio Clock with DCF77

Posted: Mon May 23, 2011 8:48 pm
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

Re: Radio Clock with DCF77

Posted: Mon May 23, 2011 9:35 pm
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 :/

Re: Radio Clock with DCF77

Posted: Mon Jun 06, 2011 8:43 pm
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

Re: MX030 - Radio Clock with DCF77

Posted: Thu Sep 15, 2011 6:24 pm
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: )