Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3, 4
DS1302 Real Time Clock Module (HCMODU0035) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: DS1302 Real Time Clock Module (HCMODU0035)
If you leave it running do the seconds tick up?

Also could try commenting out the following 3 lines:

Code:
  //rtc.setDOW(MONDAY);
  //rtc.setTime(16,30,0);
  //rtc.setDate(21,11,2015);


Then try resetting the Arduino a few times. Each time you reset it does it go back to Monday 21.01.2018 or does it continue to tick up.

If so try removing the power to the Arduino and RTC module for a minute and apply the power again. What happens this time? Does it go back to Monday 21.01.2018 or does it continue to tick up?

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Nov 23, 2015 11:39 am
Profile

Joined: Tue Oct 13, 2015 12:52 pm
Posts: 3
Post Re: DS1302 Real Time Clock Module (HCMODU0035)
1) Yes the seconds tick up:
Code:
Monday 19.01.2018 -- 00:00:00
Monday 19.01.2018 -- 00:00:01
Monday 19.01.2018 -- 00:00:02
Monday 19.01.2018 -- 00:00:03
Monday 19.01.2018 -- 00:00:04
Monday 19.01.2018 -- 00:00:05
Monday 19.01.2018 -- 00:00:06
Monday 19.01.2018 -- 00:00:07
Monday 19.01.2018 -- 00:00:08


2) Commented out the selected part:
Code:
Monday 19.01.2018 -- 00:02:48
Monday 19.01.2018 -- 00:02:49
Monday 19.01.2018 -- 00:02:50
Monday 19.01.2018 -- 00:02:51
Monday 19.01.2018 -- 00:02:52
Monday 19.01.2018 -- 00:02:53
Monday 19.01.2018 -- 00:02:54
Monday 19.01.2018 -- 00:02:55
Monday 19.01.2018 -- 00:02:56
Monday 19.01.2018 -- 00:02:57


3) did the reset. Here something weird happens, look at that 03:70 jump to 4 minutes, jump to 5 minutes. I've resetted the arduino before this (keeps counting up from where it left) and then i resetted it mid monitor:
Code:
Monday 19.01.2018 -- 00:03:66
Monday 19.01.2018 -- 00:03:67
Monday 19.01.2018 -- 00:03:68
Monday 19.01.2018 -- 00:03:69
Monday 19.01.2018 -- 00:03:70
Monday 19.01.2018 -- 00:04:81
Monday 19.01.2018 -- 00:05:44
Monday 19.01.2018 -- 00:05:45
Monday 19.01.2018 -- 00:05:46
Monday 19.01.2018 -- 00:05:47
Monday 19.01.2018 -- 00:05:48


4) waited a couple of minutes while the Arduino was disconnected (had lunch), plugged it back in, monitored:
Code:
Monday 19.01.2018 -- 00:32:19
Monday 19.01.2018 -- 00:32:20
Monday 19.01.2018 -- 00:32:21
Monday 19.01.2018 -- 00:32:22
Monday 19.01.2018 -- 00:32:23


Thu Nov 26, 2015 12:59 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: DS1302 Real Time Clock Module (HCMODU0035)
The tests do show that when left alone it is counting up correctly. The weird things seem to happen when your Arduino is reset. It's not clear what could be cauing it to do that but it could be something as simple a bad connection. I assume that you have the module connected to your Mega via some wires and not soldered to a PCB? If so are the wires long? If you can swap them around try that to see if it fixes it or causes a different problem.

One thing I forgot to ask is are you powering it from the Mega? if so do you have it connected to the 3.3V or 5V power pins?

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Thu Nov 26, 2015 2:59 pm
Profile

Joined: Tue Oct 13, 2015 12:52 pm
Posts: 3
Post Re: DS1302 Real Time Clock Module (HCMODU0035)
Image

This is my current setup, so the wires are not very long. My earlier tests used pins 6,7,8. Now I'm using pins 2,3,4. But the issue remains. I have the RTC powered from my Mega and the battery is inserted. The power from the Mega is 3v3.

I've switched it to 5V supply and now I can set my date and time!! How is this possible??
Code:
Saturday 28.11.2015 -- 12:53:00
Saturday 28.11.2015 -- 12:53:01
Saturday 28.11.2015 -- 12:53:02
Saturday 28.11.2015 -- 12:53:03
Saturday 28.11.2015 -- 12:53:04
Saturday 28.11.2015 -- 12:53:05


I unplugged the Arduino to check if it remains counting up.
Code:
Saturday 28.11.2015 -- 13:09:35
Saturday 28.11.2015 -- 13:09:36
Saturday 28.11.2015 -- 13:09:37


seems fine now? This is weird


Sat Nov 28, 2015 12:15 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: DS1302 Real Time Clock Module (HCMODU0035)
Quote:
I've switched it to 5V supply and now I can set my date and time!! How is this possible??


Ah, that will be the problem. A Mega needs a minimum of about 3V at its digital pin to see it as a logic high. If you power the RTC from a 3.3V supply then a logic high from the RTC will be just under 3V so it will be right on the edge of what the Mega will accept as a logic high. With a 5V supply a logic high from the RTC will be around 4.2V which is more than enough for the Mega.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Mon Nov 30, 2015 11:05 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 35 posts ]  Go to page Previous  1, 2, 3, 4

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD