Comments on: Arduino DCF77 v0.2 released http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/ so much time, so little to do. Tue, 30 Nov 2010 21:05:12 +0000 hourly 1 http://wordpress.org/?v=3.0.1 By: Elektrowolle > DCF77 Empfang mit Arduino http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2480 Elektrowolle > DCF77 Empfang mit Arduino Sun, 18 Apr 2010 11:28:09 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2480 [...] mein DCF-77 Empfänger ab und zu Aussetzer zeigte, funktionierte der Code von http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/ leider nicht auf [...] [...] mein DCF-77 Empfänger ab und zu Aussetzer zeigte, funktionierte der Code von http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/ leider nicht auf [...]

]]>
By: elektro_wolle http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2470 elektro_wolle Sat, 13 Feb 2010 22:10:29 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2470 Hallo Mathias, Thanks for sharing the code, but I had nearly no chance to retrieve a clean signal from the conrad DCF77 receiver. Every 3 to 4 seconds the debug information shows several short signals before the 100ms and 200ms signals. I've modified the interrupthandler to ignore the jitter: /** * Interrupthandler for INT0 - called when the signal on Pin 2 changes. */ void int0handler() { int length = millis() - previousFlankTime; if (length < 10) { // ignore jitter return; } // check the value again - since it takes some time to // activate the interrupt routine, we get a clear signal. DCFSignalState = digitalRead(DCF77PIN); } and removed the DCFSignalState assignment in the main loop. The problem concerning TCCR2 can be easily solved via the MsTimer2 Library. Changing the interrupt initialisation to: /** * Initialize the DCF77 routines: initialize the variables, * configure the interrupt behaviour. */ void DCF77Init() { previousSignalState=0; previousFlankTime=0; bufferPosition=0; dcf_rx_buffer=0; ss=mm=hh=day=mon=year=0; #ifdef DCF_DEBUG Serial.println("Initializing DCF77 routines"); Serial.print("Using DCF77 pin #"); Serial.println(DCF77PIN); #endif pinMode(BLINKPIN, OUTPUT); pinMode(DCF77PIN, INPUT); #ifdef DCF_DEBUG Serial.println("Initializing timerinterrupt"); #endif MsTimer2::set(1000, advanceClock); // 500ms period #ifdef DCF_DEBUG Serial.println("Initializing DCF77 signal listener interrupt"); #endif attachInterrupt(0, int0handler, CHANGE); } removing the old interrupthandler and added the advanceClock function: /** * The interrupt routine for counting seconds - increment hh:mm:ss. */ void advanceClock() { ss++; if (ss==60) { ss=0; mm++; if (mm==60) { mm=0; hh++; if (hh==24) hh=0; } } } The timer is started in "Parity check OK - updating time" branch via MsTimer2::start(). The sideeffect of placing the MsTimer2::start after a positive parity check is that the time is only printed after successful decoding of the DCF77 Data. I'll mail you the complete sketch for integrating the changes in a version 0.0.3 Best regards Hallo Mathias,

Thanks for sharing the code, but I had nearly no chance to retrieve a clean signal from the conrad DCF77 receiver. Every 3 to 4 seconds the debug information shows several short signals before the 100ms and 200ms signals. I’ve modified the interrupthandler to ignore the jitter:

/**
* Interrupthandler for INT0 – called when the signal on Pin 2 changes.
*/
void int0handler() {
int length = millis() – previousFlankTime;
if (length < 10) {
// ignore jitter
return;
}
// check the value again – since it takes some time to
// activate the interrupt routine, we get a clear signal.
DCFSignalState = digitalRead(DCF77PIN);
}

and removed the DCFSignalState assignment in the main loop.

The problem concerning TCCR2 can be easily solved via the MsTimer2 Library. Changing the interrupt initialisation to:

/**
* Initialize the DCF77 routines: initialize the variables,
* configure the interrupt behaviour.
*/
void DCF77Init() {
previousSignalState=0;
previousFlankTime=0;
bufferPosition=0;
dcf_rx_buffer=0;
ss=mm=hh=day=mon=year=0;
#ifdef DCF_DEBUG
Serial.println("Initializing DCF77 routines");
Serial.print("Using DCF77 pin #");
Serial.println(DCF77PIN);
#endif
pinMode(BLINKPIN, OUTPUT);
pinMode(DCF77PIN, INPUT);

#ifdef DCF_DEBUG
Serial.println("Initializing timerinterrupt");
#endif
MsTimer2::set(1000, advanceClock); // 500ms period

#ifdef DCF_DEBUG
Serial.println("Initializing DCF77 signal listener interrupt");
#endif
attachInterrupt(0, int0handler, CHANGE);
}

removing the old interrupthandler and added the advanceClock function:

/**
* The interrupt routine for counting seconds – increment hh:mm:ss.
*/
void advanceClock() {
ss++;
if (ss==60) {
ss=0;
mm++;
if (mm==60) {
mm=0;
hh++;
if (hh==24)
hh=0;
}
}
}

The timer is started in "Parity check OK – updating time" branch via MsTimer2::start(). The sideeffect of placing the MsTimer2::start after a positive parity check is that the time is only printed after successful decoding of the DCF77 Data.

I'll mail you the complete sketch for integrating the changes in a version 0.0.3

Best regards

]]>
By: Willy http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2469 Willy Sun, 24 Jan 2010 15:57:57 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2469 Hi Stefan I have just the same problem with my Arduino Pro ATmega 328 In function ‘void DCF77Init()’: error: ‘TCCR2′ was not declared in this scope I use also the latest enviroment 0017 What have you done so that it runs the program? Thanks a lot for your help, Willy Hi Stefan
I have just the same problem with my Arduino Pro ATmega 328

In function ‘void DCF77Init()’:
error: ‘TCCR2′ was not declared in this scope

I use also the latest enviroment 0017
What have you done so that it runs the program?

Thanks a lot for your help,

Willy

]]>
By: hiac http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2467 hiac Wed, 20 Jan 2010 09:58:37 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2467 It's the same form me! error: 'TCCR2' was not declared in this scope Are there any solutions until now? I'm using Nano-Board and also Arduino-Software version 0017. It’s the same form me!
error: ‘TCCR2′ was not declared in this scope
Are there any solutions until now?

I’m using Nano-Board and also Arduino-Software version 0017.

]]>
By: Jan Willem http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2466 Jan Willem Fri, 08 Jan 2010 15:42:03 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2466 I have the same error and I am using a Freeduino V1.6 wtih the Conrad DCF77 and environment 015. I have the same error and I am using a Freeduino V1.6 wtih the Conrad DCF77 and environment 015.

]]>
By: Rory http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2465 Rory Mon, 04 Jan 2010 11:03:07 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2465 I got it compiling properly by declaring the integer but also theres 2 others that need to be declared, so just add this near the top somewhere int TIMSK; int TCCR2; int OCIE2; So far with my reciever that i got today i have not got it working but its most likely my fault. Rory I got it compiling properly by declaring the integer but also theres 2 others that need to be declared, so just add this near the top somewhere

int TIMSK;
int TCCR2;
int OCIE2;

So far with my reciever that i got today i have not got it working but its most likely my fault.
Rory

]]>
By: nomike http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2461 nomike Fri, 27 Nov 2009 20:31:41 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2461 Has anyone solved the TCCR2 problem yet? I'm using environment version 0017 too, and a duemilanove with an "ATMEGA328". Has anyone solved the TCCR2 problem yet? I’m using environment version 0017 too, and a duemilanove with an “ATMEGA328″.

]]>
By: Stefan http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2451 Stefan Tue, 20 Oct 2009 22:06:23 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2451 Hi md I just found your latest code on the project. but sadly I still can't make it work with my diecimila > In function 'void DCF77Init()': error: 'TCCR2' was not declared in this scope I use the latest enviroment 0017 - is this a problem? Thanks a lot, Stefan Hi md

I just found your latest code on the project. but sadly I still can’t make it work with my diecimila >

In function ‘void DCF77Init()’:
error: ‘TCCR2′ was not declared in this scope

I use the latest enviroment 0017 – is this a problem?

Thanks a lot,
Stefan

]]>
By: Sascha http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2447 Sascha Sat, 10 Oct 2009 21:17:42 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2447 Hallo Mathias, versuche mich auch gerade darin, Deine DCF77 Software auf meinen Arduino zu übertragen. Leider habe auch ich einen Fehler beim Compilieren, weil TCCR2 nicht definiert ist. Liegt das an V017 der Arduino Software? Hallo Mathias,

versuche mich auch gerade darin, Deine DCF77 Software auf meinen Arduino zu übertragen.
Leider habe auch ich einen Fehler beim Compilieren, weil TCCR2 nicht definiert ist.
Liegt das an V017 der Arduino Software?

]]>
By: Richard http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/comment-page-1/#comment-2420 Richard Sat, 06 Jun 2009 18:39:03 +0000 http://gonium.net/md/2007/01/06/arduino-dcf77-v02-released/#comment-2420 Hi Mathias, thanks for your very nice job. I have an Arduino Duemilanove ATMEGA 328 and no idea on the diff with 168... Pb whith TCCR2 at compile... Thanks. Hi Mathias,
thanks for your very nice job.

I have an Arduino Duemilanove ATMEGA 328 and no idea on the diff with 168…

Pb whith TCCR2 at compile…

Thanks.

]]>