0
Offline
Newbie
Karma: 0
Posts: 43
Arduino rocks
|
 |
« Reply #75 on: June 03, 2009, 07:45:16 am » |
No you can remove byte data[56], it's not used.
|
|
|
|
|
Logged
|
|
|
|
|
Milano, Italy
Offline
Faraday Member
Karma: 10
Posts: 3080
Sideralis Arduino!
|
 |
« Reply #76 on: June 03, 2009, 10:25:15 am » |
What's the meaning of this part of the code? for(int i=0; i<56; i++) { RTC.set_sram_byte(i+64,i); }
And... Is there someone that can give me an example on how to program an alarm? Last thing.. for setting up the base time, we have to set the rtc, but there is a delay between the time that I write and the time of setting, as the arduino needs a couple of seconds for compiling the code... someone knows a more professional method to set up the rtc, instead of guessing the time needed to compile? Thanks, Fede
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Faraday Member
Karma: 6
Posts: 2504
|
 |
« Reply #77 on: June 03, 2009, 11:22:29 am » |
for setting up the base time, we have to set the rtc, but there is a delay between the time that I write and the time of setting, as the arduino needs a couple of seconds for compiling the code... someone knows a more professional method to set up the rtc, instead of guessing the time needed to compile? Put a future time in the code, and have the sketch a) print the time, and b) use Serial.available() to wait for a character transmission to actually initiate the clock set. That's how I did it, anyway. -j
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 43
Arduino rocks
|
 |
« Reply #78 on: June 04, 2009, 06:43:05 am » |
I had a pde which listened to the serial input and looked for the following sequences, and set the clock accordingly. Snn Mnn Hnn Dddmmyy I can;t find my pde  Not hard to write though.
|
|
|
|
« Last Edit: June 04, 2009, 06:43:40 am by mattt »
|
Logged
|
|
|
|
|
Milano, Italy
Offline
Faraday Member
Karma: 10
Posts: 3080
Sideralis Arduino!
|
 |
« Reply #79 on: June 04, 2009, 03:13:33 pm » |
If you find it, it will be appreciated  Oh, and thanks for the library! Any hint about the alarm? (two or three post above)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 43
Arduino rocks
|
 |
« Reply #80 on: June 04, 2009, 07:53:27 pm » |
For an alarm you'd probably be better off with a DS1337, that has two alarms. xSmurf wrote a lib for it. Read from here : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1191209057/6#6With the DS1307, you'll could periodically read the RTC data and compare it against a predetermined time.
|
|
|
|
|
Logged
|
|
|
|
|
Milano, Italy
Offline
Faraday Member
Karma: 10
Posts: 3080
Sideralis Arduino!
|
 |
« Reply #81 on: June 05, 2009, 04:43:12 am » |
Thank you! I don't really need an alarm now, but I wanted to understand this chip as better as possible. Great, great work mattt, and everyone who contributed!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 1
Arduino rocks
|
 |
« Reply #82 on: June 14, 2009, 05:07:09 pm » |
Mattt
Have you had a chance to update this library to include the 12 hour, AM/PM mode?
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 1
Arduino rocks
|
 |
« Reply #83 on: July 13, 2009, 05:15:29 am » |
Thanks for you work Mattt and others!
Downloaded the code from Google code and had it up and running in no time.
Much appreciated!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 10
Arduino rocks
|
 |
« Reply #84 on: August 13, 2009, 04:30:25 pm » |
I observe a strange behaviour on some of the SRAM registers on my DS1307 ...
Like in the example, I am resetting the SRAM with
for(int i=0; i<56; i++) { RTC.set_sram_byte(65,i); }
and then reading it with RTC.get_sram_data(data); for(int i=0; i<56; i++) { Serial.print(data+0); Serial.print(" "); }
the result is strange:
65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 18 65 4 65 8 65 3 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65
i.e. I seem to have registers 26, 28, 30, 32 which apparently contain other values than what I wrote into them? Anybody got an idea why that might be?
|
|
|
|
« Last Edit: August 13, 2009, 04:32:24 pm by dg1sek »
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 0
Posts: 379
Arduino rocks
|
 |
« Reply #85 on: September 30, 2009, 02:01:49 pm » |
Hi, I would like also to develop a scientific devide consisting on a arduino duemilenove, two (for the moment) temperature sensors (DS18N20), a RTC (DS1307), and a microSD component. My idea is to measure temperature from each sensor one per hour, and save in a txt file at the microSD file, together with date, time and the temperature from each sensor. I saw some of you are involve in similar devides. Since i am completely new in arduino, could you give me the detailed steps to develop it? You seems to have so much experience and could made me easy to go ahead with this project. Details about what i have: Arduino duemilenove: http://www.bricogeek.com/shop/10-arduino-duemilanove-usb.htmlTemperature sensors DS18B20: http://www.bricogeek.com/shop/41-sensor-de-temperatura-ds18b20-one-wire.htmlRTC DS1307: http://www.bricogeek.com/shop/56-placa-reloj-rtc-ds1307.htmlMicroSD: http://www.libelium.com/tienda/catalog/product_info.php?cPath=21&products_id=66Thanks!
|
|
|
|
« Last Edit: September 30, 2009, 02:10:10 pm by madepablo »
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 115
Arduino rocks
|
 |
« Reply #86 on: October 10, 2009, 10:09:53 pm » |
New DS1337 owner here, should I jump in with the code posted at the beginning of the thread specifically for the DS1337 or go with the DS1307 library listed later on Google source?
I picked up a nice couple of CronoDots with the headers soldered on the wrong side for cheap at macetech.com. Look for the ChronoDoh!
|
|
|
|
|
Logged
|
|
|
|
|
Boston, MA
Offline
Edison Member
Karma: 0
Posts: 1024
wiblocks
|
 |
« Reply #87 on: October 11, 2009, 11:51:21 am » |
If you are just starting out on the DS1337 you may want to checkout my library at http://tinyurl.com/pg334s. I have implemented most functions of the chip. The library works with the Arduino and Sanguino. I have a couple of Arduino examples on the site. One outputs a localtime string. The other demos the interrupts. I will be posting the Sanguino examples (with pics of my new board) in the next few days. (* jcl *) ------------------------------------ www: http://www.wiblocks.comtwitter: http://twitter.com/wiblocksblog: http://luciani.org
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 115
Arduino rocks
|
 |
« Reply #88 on: October 14, 2009, 08:42:05 pm » |
Ha ha! It lives!
Soldered the backup battery on, wired it up very carefully, and tried the most basic sketch from the macetech.com documentation that doesn't use any library.
It's ticking and spitting out the wrong time! (I haven't set it yet)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 115
Arduino rocks
|
 |
« Reply #89 on: October 16, 2009, 09:24:57 am » |
ok, tried jluciani's library first. Nothing comes back on the serial port at all. Here is what I tried: #include <TWI.h> #include <RTC.h>
#define int_enable PCICR |= (1 << PCIE1) #define int_disable PCICR &= ~(1 << PCIE1)
RTC rtc;
void setup() { Serial.begin(9600); // setup the TWI
TWBR = TWI_TWBR; // Set bit rate register (Baudrate). Defined in TWI.h TWDR = 0xFF; // Default content = SDA released.
TWCR = (1<<TWEN)| // Enable TWI-interface and release TWI pins. (0<<TWIE)|(0<<TWINT)| // Disable Interupt. (0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // No Signal requests. (0<<TWWC);
int_enable;
// initialize the date // rtc.set_date(2009, 9, 30);
// intialize the clock // rtc.set_time(18, 37, 0); }
void loop() { char timestr[22]; while(1) { rtc.read_regs(); rtc.localtime(timestr); Serial.print(timestr); Serial.print("\r"); delay(1000); } }
|
|
|
|
|
Logged
|
|
|
|
|
|