Go Down

Topic: rtc spi help 1305 and 1302 3wire also epoch (Read 2267 times) previous topic - next topic


Jan 16, 2013, 08:22 pm Last Edit: Jan 17, 2013, 12:04 am by grendle Reason: 1
greetings. i have available 1302 and 1305(of which i would like to use 1305). i looked through the posts here and found this http://arduino.cc/forum/index.php?PHPSESSID=edc377455dd4ccb8fe7325bda4d0ce0a&topic=54467.0     but i dont understand exactly whats going on in some parts. the code im trying to use works on other spi devices and im not getting anything on the 1305 ive setup. ive tied SERMODE to +5 to indicate spi mode, vice 3wire, and grounded all unused power pins as per the datasheet. i know these are old parts but im not able to get a 1307 or any other rtc for that matter. i need to use what i have. plus im having trouble with i2c which is another topic.

Code: [Select]
#include <SPI.h>
#define ss 10//ss

void setup() {
 byte r=SPI.transfer(0);
 Serial.println(r, BIN);
 void loop() {

i get a 128 returned from this. ive tried the code from the other post with the suggested fixes and get nada also. any insight? or better yet anyone have a simple to understand sketch, either transfering one byte at a time or burst mode read with lots of comments. thank you. also with the 1302 which i would use, im not understanding the read, of which im sure is the simplest thing im missing. i would like to move on to other sensors, but an rtc is paramount i think in any project. my robot will never take over the world if he cant at least tell time.

also interested in using epoch to store timestamp, i see alot of posts using this method, some suggestions from ppl, but no real instructions on setting it up and executing it. thank you.


I don't know the DS1305, but I made this for the DS1302 : http://playground.arduino.cc/Main/DS1302
The communication with the DS1302 is something special, it is not the normal SPI.


thank you for that, im running with the 1302, im going to try this later with the 1305 since it does spi and the same "3wire" the 1302 uses. i probably should have been a little more clear in my post, not only in getting these rtc's running, but timestamping them with some kind of real world sample to an eeprom. your work is getting me in the right direction thank you.


Jan 18, 2013, 12:05 pm Last Edit: Jan 19, 2013, 08:56 am by Krodal Reason: 1
I have to note the Arduino pinMode() did change.
The way the internal pull-up is used did change. I have to look some day into the source code of that function to see how it is implemented, and doesn't cause a glitch on the output.


well your efforts will not go unnoticed, as i have several 1302's so im going to use them. im sure other ppl use them also. thank you for your time and effort. i used these several years ago on the Basic Stamp, but the Uno is just so much more, better, im not going backwards ^^ thx again!

Go Up