rodan / ds3234 Goto Github PK
View Code? Open in Web Editor NEWarduino library for DS3234 RTC
Home Page: http://www.maxim-ic.com/datasheet/index.mvp/id/4051
arduino library for DS3234 RTC
Home Page: http://www.maxim-ic.com/datasheet/index.mvp/id/4051
Hi, thanks for the great library.
I notice that nearly all routines for reading and writing the time follow the same process that "could" lead to invalid time/date reading. From the PDF it says the register value is copied upon CS to prevent rollover screwing with the time/date.
My suggestion is to Set CS, read/write all required registers then unset CS.
I know that it would probably be rare to be reading the time/date regs during a rollover.
But to be the best maybe a few adjustment to the code????
From the PDF ...
When reading or writing the time and date registers,
secondary (user) buffers are used to prevent errors
when the internal registers update. When reading the
time and date registers, the user buffers are synchronized
to the internal registers on the falling edge of CS
or and when the register pointer rolls over to zero. The
time information is read from these secondary registers,
while the clock continues to run. This eliminates the
need to reread the registers in case the main registers
update during a read.
Have you tried it on a ESP8266?
I have it working using a bit-banged version not the inbuilt SPI library.
The seconds seem to read ok, but the subsequent reads dont get the right data.
I did have some luck by setting CS, read all 7 regs then unset CS.
Any thoughts?
1900.00.00 00:48:08
1900.00.00 00:52:13
1900.00.00 00:48:18
1900.00.00 00:52:23
1900.00.00 00:48:28
1900.00.00 00:52:33
1900.00.00 00:48:38
1900.00.00 00:52:43
1900.00.00 00:48:48
1900.00.00 00:52:53
1900.00.00 00:48:58
1900.00.00 12:53:03
Line 76:
if (t.year > 2000) {
should be
if (t.year >= 2000) {
This is the output im getting off the example with 2 changes (cs set to 7 and "pinMode(10, OUTPUT);" since pin 10 has to be output for SPI for some reason...):
GET time
1917.05.20 68:24:45
1917.05.20 68:24:50
1917.05.20 68:24:55
1917.05.20 68:25:00
1917.05.20 68:25:05
1917.05.20 68:25:10
1917.05.20 68:25:15
1917.05.20 68:25:20
1917.05.20 68:25:25
1917.05.20 68:25:30
1917.05.20 68:25:35
1917.05.20 68:25:40
1917.05.20 68:25:45
Month, day and seconds seem to be right. First 2 digits of Year and first digit hour obviously not, minutes are 10 too low, so first digit.
Correct output would be eg:
2017.05.20 18:35:45 (where this is GMT and i would currently have GMT +2h here, but thats no issue since the problem exists with summer time saving anyway...
Edit:
If the time is set outside of this library I can correctly read it back with the this library - only with 1917 instead of 2017 as the year:
1917.05.20 21:39:31
1917.05.20 21:39:36
1917.05.20 21:39:41
1917.05.20 21:39:54
This post fixed the problem, you may want to update the library/examples to reflect this.
Thanks for this library
http://forum.arduino.cc/index.php?topic=309872.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.