system
June 19, 2012, 4:04am
1
Hi,
I am new to Arduino and new here. Recently i got a Arduino Uno and a Nuelectronics data logger with ds1302 rtc. Anyone here could help me with the code that i need for the rtc setting? thanks.
I have been searching the whole web and copied some codes but errors came out.
Please help.
system
June 19, 2012, 8:56am
2
If you tell us the errors we might be able to help you understand what they mean, and hence cure them.
What have you tried, and what results have you had?
Remember to post any code inside code tags (press the [#] button above the edit window).
Riva
June 19, 2012, 10:48am
3
Hi juliuskj,
A quick look and it seems the RTC uses digital pins 3,4 & 6 as SCLK, IO & CE respectfully. Someone has written a library for the DS1302 here GitHub - msparks/arduino-ds1302: Arduino library for the DS1302 Real Time Clock chip with an example sketch. Just alter the lines
/* Set the appropriate digital I/O pin connections */
uint8_t CE_PIN = 5;
uint8_t IO_PIN = 6;
uint8_t SCLK_PIN = 7;
to match your needs.
Erni
June 19, 2012, 10:55am
4
I have used this library and example sketch with my Uno and nuelectronics shield
http://www.henningkarlsen.com/electronics/library.php?id=5
Try the DS1302_Serial_Easy sketch that commes with the library and change the line to:
// Init the DS1302
DS1302 rtc(6, 4, 3);
You can find more examples here:
http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=7&products_id=20&zenid=cdc42b74b271bd43b2ac71625a607cb8