Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
mallobag
PostPosted: Aug 02, 2012 - 02:16 PM
Newbie


Joined: Jul 19, 2012
Posts: 4


does anyone have a code example for this kind of programm?

i want to programm a RTC what syncs with the dcf radio signal. ive found some similar programms but most of them dont work because of the interrupt
(old programms on tiny and mega8).

im not a freak in interrupts so maybe someone have a hint for me .

the programm shuld tgl the led on portE every second but it dont
 
 View user's profile Send private message  
Reply with quote Back to top
DO1THL
PostPosted: Aug 02, 2012 - 02:42 PM
Resident


Joined: Aug 29, 2002
Posts: 786
Location: Muenster, Germany

I've done a DCF77 receiver to show the currently active amateur radio beacons. Quite early in the coding stages, i switched from interrupt-driven signal reception to polling based on a timer. The signal is much too flakey to be useful as an interrupt source.

So, setup a 1ms timer, read the state of your DCF receiver pin each ms, integrate it to get it averaged over some time, and then make your decision after let's say 120 ms if the pulse was a short or a long one.

In addition, my particular DCF receiver shortened the length of its pulses when the received signal got weaker, so don't hang up on the specification of DCF77 for what makes a short vs. a long pulse.

_________________
Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Aug 02, 2012 - 03:01 PM
10k+ Postman


Joined: Feb 12, 2005
Posts: 16323
Location: Wormshill, England

If you try making any DCF77 of MSF clock, you must do serious error checking.
The signal is likely to have many glitches, so you only 'correct' a free running AVR timer when every check bit is correct (and field values are reasonable).

I am pretty sure that my Kitchen Clock works like this. i.e. only listens to MSF60 every few hours, and makes a correction if necessary.

Don't try to display the raw decoded time every minute. Your cakes will burn !

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
jayjay1974
PostPosted: Aug 02, 2012 - 04:06 PM
Raving lunatic


Joined: Oct 30, 2002
Posts: 5720
Location: The Netherlands

When I did my DCF77 decoder I didn't adjust until it received two consecutive frames that differed only one minute in time (and that the parity checks are ok).

My latest DCF77 enabled clock that I bought checks the radio signal only at 2:00 AM; or on demand by pressing the 'wave' button.
 
 View user's profile Send private message  
Reply with quote Back to top
mojo-chan
PostPosted: Aug 03, 2012 - 02:30 PM
Resident


Joined: Jan 24, 2008
Posts: 521


http://www.electronics-lab.com/projects ... index.html
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits