RTC won't increment on SD board (PCF8523)

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
fsonnichsen
 
Posts: 20
Joined: Mon Aug 26, 2013 4:44 pm

RTC won't increment on SD board (PCF8523)

Post by fsonnichsen »

I have installed the SD shield with the PCF8523 on am ATMega arduino.
I have loaded the PCF8523 program provided by adafruit to check out the RTC. However the time does not increment.
I forced the update of the RTC to a new datetime value just to be sure comms is working to the clock and I see the new time in the output on the serial port. I also wrote and 0x58 to reg0 of the 8523 to force a reset. Still the time does not increment.

Software issue or should I head for the soldering iron?
thanks
fritz

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: RTC won't increment on SD board (PCF8523)

Post by Franklin97355 »

Let's see a picture of the board, both sides and your code. By not incrementing do you mean the output you get in the serial monitor is always the same? Post some of your output for us to examine please.

User avatar
fsonnichsen
 
Posts: 20
Joined: Mon Aug 26, 2013 4:44 pm

Re: RTC won't increment on SD board (PCF8523)

Post by fsonnichsen »

The program is the identical one provided by adafruit on the product page. I have cut and pasted the main source below. Also attached a pic of the board. It is the most recent version. The out put is pasted below-
thanks
fritz

====================================
2011/5/28 (Saturday) 9:10:1
since midnight 1/1/1970 = 1306573801s = 15122d
now + 7d + 30s: 2011/6/4 21:40:7

2011/5/28 (Saturday) 9:10:1
since midnight 1/1/1970 = 1306573801s = 15122d
now + 7d + 30s: 2011/6/4 21:40:7

==================================================

// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"

RTC_PCF8523 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

while (!Serial) {
delay(1); // for Leonardo/Micro/Zero
}

Serial.begin(57600);
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}

if (! rtc.initialized()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
// rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
}

void loop () {
DateTime now = rtc.now();

Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" (");
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(") ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();

Serial.print(" since midnight 1/1/1970 = ");
Serial.print(now.unixtime());
Serial.print("s = ");
Serial.print(now.unixtime() / 86400L);
Serial.println("d");

// calculate a date which is 7 days, 12 hours and 30 seconds into the future
DateTime future (now + TimeSpan(7,12,30,6));

Serial.print(" now + 7d + 30s: ");
Serial.print(future.year(), DEC);
Serial.print('/');
Serial.print(future.month(), DEC);
Serial.print('/');
Serial.print(future.day(), DEC);
Serial.print(' ');
Serial.print(future.hour(), DEC);
Serial.print(':');
Serial.print(future.minute(), DEC);
Serial.print(':');
Serial.print(future.second(), DEC);
Serial.println();

Serial.println();
delay(3000);
}
Attachments
board1.jpg
board1.jpg (93.59 KiB) Viewed 314 times

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: RTC won't increment on SD board (PCF8523)

Post by Franklin97355 »

You have the older version of the board with a DS1307 and not the PCF8523. You may also need to short some jumpers as mentioned in the tutorial.

User avatar
fsonnichsen
 
Posts: 20
Joined: Mon Aug 26, 2013 4:44 pm

Re: RTC won't increment on SD board (PCF8523)

Post by fsonnichsen »

Darn! You're right-I think I had an older board laying about along with the new one and probably mixed them up at some point. I think the 8523 has the same pinout as the 1307 so I may just replace it-----trying to keep consistent here. Not sure how to assure that I get a newer board next time

thanks
fritz

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: RTC won't increment on SD board (PCF8523)

Post by Franklin97355 »

If you buy from us you will get the new one.

User avatar
fsonnichsen
 
Posts: 20
Joined: Mon Aug 26, 2013 4:44 pm

Re: RTC won't increment on SD board (PCF8523)

Post by fsonnichsen »

Great and thanks! I cannot honestly figure out where I got the older boards from--quite a clutter in my lab here and it probably was from some time ago. I will go ahead and order a few today
cheers
fritz

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”