-->
Raspberry Pi with DS1302 RTC not working properly
-->
-->
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
-->
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
General Discussion
»
Technology and Development
»
Computer Usage and Setup Help
»
Raspberry Pi with DS1302 RTC not working properly
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Raspberry Pi with DS1302 RTC not working properly (Read 11579 times)
0 Members and 1 Guest are viewing this topic.
ElementCoder
LV7
Elite (Next: 700)
Posts: 611
Rating: +42/-2
Raspberry Pi with DS1302 RTC not working properly
«
on:
July 04, 2015, 08:22:18 am »
Hello guys, it's been some time
I'm no longer doing much with calculators, but I'm still programming quite a lot. Currently I'm building a telescope with some class mates and I'm writing the software for its control. We use a Pi B+ to manage everything but since it doesn't have its own clock I figured I'd buy an RTC module. The project is almost due though so getting the Adafruit one for the Pi would have taken too long so I bought one at a local store, a DS1302 (
http://www.okaphone.com/artikel.asp?id=472987
, sorry for the dutch). It's originally for the Arduino I believe, but I followed this guide to use it with my Pi:
http://raspberrypi.stackexchange.com/questions/12310/would-it-be-possible-to-use-the-ds1302-made-for-arduino
It now works in the sense that I can set the time and read from it, but I've encountered a major problem: the clock doesn't seem to "tick" when unplugged from the Pi. It remembers the time it had before disconnecting though, so I don't believe the battery is dead. In the datasheet I found
http://datasheets.maximintegrated.com/en/ds/DS1302.pdf
I found something about a clock halt flag, but I'm not sure if that's it or how to fix it.
Is anyone familiar with this (type of) clock and could help me fix it? It would greatly ease the user experience
Logged
Some people need a high five in the face... with a chair.
~EC
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Re: Raspberry Pi with DS1302 RTC not working properly
«
Reply #1 on:
July 04, 2015, 08:59:09 am »
The battery may still be dead if it uses flash to save the time, as that doesn't need a power source.
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
ElementCoder
LV7
Elite (Next: 700)
Posts: 611
Rating: +42/-2
Re: Raspberry Pi with DS1302 RTC not working properly
«
Reply #2 on:
July 04, 2015, 10:13:14 am »
Taking out the battery and reinserting it resets the clock to November 30, 1990 so it most likely does use it to keep its time.
Logged
Some people need a high five in the face... with a chair.
~EC
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Re: Raspberry Pi with DS1302 RTC not working properly
«
Reply #3 on:
July 04, 2015, 10:16:41 am »
Maybe you can overgo the isssue by having the pi automatically set the clock as soon as you connect it?
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
ElementCoder
LV7
Elite (Next: 700)
Posts: 611
Rating: +42/-2
Re: Raspberry Pi with DS1302 RTC not working properly
«
Reply #4 on:
July 04, 2015, 11:00:41 am »
Well I the reason I bought this clock is that the Pi will not have internet so it will loose track of the time. We get around it now by manually setting the correct time and then continuing with what needs to be done (still a lot easier than just setting time on the pi imo
) so that won't be an option sadly.
Logged
Some people need a high five in the face... with a chair.
~EC
ElementCoder
LV7
Elite (Next: 700)
Posts: 611
Rating: +42/-2
Re: Raspberry Pi with DS1302 RTC not working properly
«
Reply #5 on:
July 07, 2015, 12:20:52 pm »
Okay it seems to work now. The problem looks like being I "shut down" the pi by just pulling the cord quite a lot. Just using the shutdown command (as I should) makes it work fine.
(sorry for double post)
Logged
Some people need a high five in the face... with a chair.
~EC
Sorunome
Fox Fox Fox Fox Fox Fox Fox!
Support Staff
LV13
Extreme Addict (Next: 9001)
Posts: 7920
Rating: +374/-13
Derpy Hooves
Re: Raspberry Pi with DS1302 RTC not working properly
«
Reply #6 on:
July 08, 2015, 03:26:56 pm »
Good you figured it out!
Also, double-posts if the last post is more than a day old or if there was a project update are fine
Logged
THE GAME
Also, check out
my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
General Discussion
»
Technology and Development
»
Computer Usage and Setup Help
»
Raspberry Pi with DS1302 RTC not working properly
\n\t\t\t\t\t\t\t\t\t
<' + '/div>\n\t\t\t\t\t\t\t\t\t
%body%<' + '/textarea>
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
Max characters: 20000; characters remaining:
...<' + '/span><' + '/span>
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t<' + '/div>\n\t\t\t\t\t\t\t\t<' + '/div>', sTemplateSubjectEdit: '
', sTemplateBodyNormal: '%body%', sTemplateSubjectNormal: '
%subject%<' + '/a>', sTemplateTopSubject: 'Topic: %subject% (Read 11579 times)', sErrorBorderStyle: '1px solid red' }); aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "
Jump to:<" + "/label> %dropdown_list%", iCurBoardId: 182, iCurBoardChildLevel: 1, sCurBoardName: "Computer Usage and Setup Help", sBoardChildLevelIndicator: "==", sBoardPrefix: "=> ", sCatSeparator: "-----------------------------", sCatPrefix: "", sGoButtonLabel: "go" }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: smf_scripturl, bShowModify: true, iBoardId: 182, iTopicId: 22093, sSessionId: "bd3f1b2da10cf0ebbdd0bc785ebcf40f", sSessionVar: "e5a52c3b3dd", sLabelIconList: "Message Icon", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" }); } function tick2() { if (typeof(document.forms.quickModForm) != "undefined") { calcCharLeft2(); setTimeout("tick2()", 1000); } else setTimeout("tick2()", 800); } function message_onkeyup() { if (typeof(document.forms.quickModForm) != "undefined" && typeof(document.forms.quickModForm.message) != "undefined") { document.forms.quickModForm.message.onkeyup = function onkeyup(event) { storeCaret(this); calcCharLeft2(); }; } else setTimeout("message_onkeyup()", 800); } message_onkeyup(); function calcCharLeft2() { var maxLength = 20000; var oldEditor = "", currentEditor = document.forms.quickModForm.message.value; if (!document.getElementById("editorLeft2")) return; if (oldEditor != currentEditor) { oldEditor = currentEditor; if (currentEditor.replace(/\r/, "").length > maxLength) document.forms.quickModForm.message.value = currentEditor.replace(/\r/, "").substring(0, maxLength); currentEditor = document.forms.quickModForm.message.value.replace(/\r/, ""); } setInnerHTML(document.getElementById("editorLeft2"), maxLength - currentEditor.length); } // ]]>-->