DCF77 needs Serial monitor for 5 mins - Weird

Hi,

Can someone please help.......?

I am using a DCF77 with Thijs Elenbaas library as it exists. On an UNO.

All code works perfectly as long as I have Serial Monitor on (not just USB connected to PC).

However, if I do not have a Serial Monitor the DCF77 software will never 'time' update and remains stuck in a loop. If I connect the Serial monitor ( and Uno resets ) the DCF77 will update time in 2 or 3 mins and then keep updating even if I disconnect the Serial Monitor.

So every time I power-up my project I need to connect Serial Monitor for about 5 mins till the DCF77 updates time, which is a real pain.

I have googled and there is a person with the EXACT opposite of my problem. Code only works when NO Serial Monitor. His solution was to buy a different DCF77 !!!!!

some notes ... 1) In Thijs Elenbaas website examples he refers to 'Utils', but this does not seem in be used in library (though in zip file).

2) I am not clear if In need #define VERBOSE_DEBUG 0 or 1 - does not do anything for me.

3) All print commands are commented out - so no output on Serial Monitor

Lastly can I 'fool' the UNO in thinking Serial monitor is on, as a solution B ??

This problem just does not make sense to me - so hopefully someone can point me....

Thanks

I can’t see a problem with any of the code that you have not posted.

read this before posting a programming question

Hi,

Apologies...

I am running in effect Thijs Elenbaas's InternalClockSync library example. I am actually outputting time e.g 12:34 to a Colorduino display - my project is a clock.

Which works perfectly as long as I have a Serial Monitor running. If I comment out all the print statements and do not have a Serial monitor running, DCFtime below never becomes a '1'.

digitalClockDisplay(); below has been replaced by my own display routine to write to Colorduinos.

Again all code runs perfectly but ONLY with Serial Monitor running for first 5 mins.....

Thanks

Extract of Thijs Elenbaas's InternalClockSync follows........

include "DCF77.h"

include "Time.h"

define DCF_PIN 2 // Connection pin to DCF 77 device

define DCF_INTERRUPT 0 // Interrupt number associated with pin

time_t time; DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);

void setup() { Serial.begin(9600); DCF.Start(); Serial.println("Waiting for DCF77 time ... "); Serial.println("It will take at least 2 minutes until a first update can be processed."); }

void loop() { delay(1000); time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available if (DCFtime!=0) { Serial.println("Time is updated"); setTime(DCFtime); } digitalClockDisplay(); }

Code tag's

But I doubt you need to open Serial monitor. I think a rest when connected to the PC is okay. And then is sounds like an Earth problem to me. Looks like the DCF77 is more happy being connected to mains earth...

Hi septillion,

Thanks will try earth and get back - I am running on a 9V psu when self powered -

but I am not sure what changes when Serial monitor is on - does not work if USB is connected as well which should also have the earth.

Will get back ...

PS - just found out what code tag's are, still a newb... code tag's

That's why there is a "Read this before posting a programming question..." topic ;)

Yeay, when usb is connected there is earth. But the Serial monitor will reset the Arduino when you open it ;)

Hi septillion,

Just rigged up an earth and it WORKS !!! I tried it 5 times !!!

While I understand the need for an earth and the DCF77 radio signal, I would never have come up with this solution as the USB being connected would eliminate this solution.

I have attached a photo of my work in progress clock - because the seconds ‘:’ indicator is NOT red, I know the DCF77 is time updated.

so all I can say is

void loop() {

Serial.println(" Thank you !!!!!");

}