DS3231 to replace DS1307?

Hi all. I am making a time lapse controller, and the code I have uses a DS1307 to wake up at certain times. I have seen a few places where people have used DS3231’s as direct replacements - and said the code for the 1307 will work fine with no modifications, is this correct?

thanks!

Hello, I think it's correct, but make sure they use the same protocol! There are I2C and SPI versions.

http://www.l8ter.com/?p=417

guix: Hello, I think it's correct, but make sure they use the same protocol! There are I2C and SPI versions.

http://www.l8ter.com/?p=417

The DS-3231 is I2C only. The SPI version has a different model number.

Lefty

Aren't the pinouts quite a bit different as well from the 8-pin DS1307 to the 16 pin DS3231? Register usage is a little different, compare 0-7 with 0-7 on both. Maybe not enough to matter if you are not using the Stop Counting bit of the seconds register, and the century bits of the year, or the NVRAM data.

http://datasheets.maximintegrated.com/en/ds/DS1307.pdf http://datasheets.maximintegrated.com/en/ds/DS3231.pdf

thanks all! no worries about the different packages, just wondered about the code needed to get them working.

What do you mean about the register useage?

I'm using code from openmoco http://openmoco.svn.sourceforge.net/viewvc/openmoco/miniE/trunk/miniE/

I can't find much refering too the RTC in the code yet as its massive, so far only found this in the main program file

  // our Real time clock object
RTC_DS1307 RTC;
  // and the current time of the system
DateTime time;

Read the datasheets, Table 2 in DS1307 & Figure 1 in DS3231. Your comments lead me to think you're not familiar with the software you're using tho, so it might be a moot point.

ah thanks, for the basic functions it looks like they use the same registers.

no certainly not familiar with the software I'm using, way to advanced for a beginner like myself to get my head around, but I will systematically go through and try and work out whats doing what because I will want to make a few minor changes.

Thanks again