CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

CCS driver DS1307 and DS3231 compatibility

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

CCS driver DS1307 and DS3231 compatibility
PostPosted: Tue Mar 15, 2016 4:41 am     Reply with quote

Dear Board

I'm using DS1307 driver from CCS and it is working good with my PIC, but due to limitation of accuracy of DS1307 I'm planning to migrate to DS3231.

Can i directly replace DS1307 with DS3231?

I don't find a specific ccs driver for DS3231 in drivers folder. But, in code section of this forum a code is available that is not so simple to understand. It is kind of messy and not as neat as DS1307 driver.

I read in few forums that they both chips are just compatible in SW point of view.

Can anyone plz confirm if they are equally interchangeable.

Thank you
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Tue Mar 15, 2016 5:03 am     Reply with quote

Get the datasheets for the two devices, they are available online, and read them carefully. Compare the two and report back to us whether they are truly compatible, almost compatible, or different.
temtronic



Joined: 01 Jul 2010
Posts: 9163
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 15, 2016 5:08 am     Reply with quote

All you have to do is download the datasheets for both DS products from their website and read them. Compare timeing, register structures, memory maps, etcs.
While I use the DS1307, I've never looked at the DS3231. Part of being a tech or hobbiest is reading the manuals. Not knowing what specific feature of the RTC chip you need may not work with te 1307 driver, it's up to you to 'do your homework' and read up on them.

Also after reading, I always breadboard and test new chips with basic code, confirm it 'works' THEN code for what features I need to use. After that I test in the real world for several days.

Jay
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

PostPosted: Tue Mar 15, 2016 5:22 am     Reply with quote

I understood, so, i will be the first person to say in this forum the compatibility between DS3107 and DS3231.

sure. once after i finish the DS comparision i will re-open this post and mention here result of my study..

By the way..for your information DS3231 is highly accurate RTC with some more funcitons + temperature compensation clock. which is equally cheaper as DS1307

Thank you.
temtronic



Joined: 01 Jul 2010
Posts: 9163
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 15, 2016 5:56 am     Reply with quote

I printed off the 'timekeeping' register maps of the two RTC as I got curious.
They are NOT the same,though regs00x - 06x seem similar after that it's totally different.
As well the 3231 lacks ANY RAM, so IF I were to buy this series I'd go with the 3232. Having battery backed SRAM, off PIC is always GREAT !
Be sure to use PCM Ps 'I2C scanner' program from the code library to base line test that the PIC can see the DS3231.
I don't understand why any mfr would include a temp sensor that's 3*C variable...can't be used for temp control. Though I suppose I should read the specs, having to adjust code to compensate, well, seems silly.
I would copy the DS1307 driver, name is DS3231,then modified-add code to it. Now providing the basic 'timekeeping' works, the rest of the new driver should only take 1/2 day or so.

Jay
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

PostPosted: Tue Mar 15, 2016 6:25 am     Reply with quote

"Thumbs Up" for your curiosity

In deed i will also work.. but for me it will take a long time.. because i just now ordered board from Ebay 3231. so after it arrives i will start my work..

another thing.. I will not use temperature from chip.. all I will concentrate is on date and time functions.. so my driver will be lite. Smile
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Mar 15, 2016 7:32 am     Reply with quote

Compare what i consider the single most important spec of an RTC chip:
battery POWER SUPPLY current. There is a NOTABLE difference when in active read/write mode but for the long haul -- you are proposing to use a chip that consumes 450uA of current over one that uses typically 250nA of standby battery current AND for WHAT??:

The oscillator in the 3231 has slightly worse stability than a quality crystal used with the 1307. What is the big attraction of this inferior chip?
temtronic



Joined: 01 Jul 2010
Posts: 9163
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 15, 2016 7:42 am     Reply with quote

It's newer so it HAS to be better ???
I don't know....then again I haven't 'upgraded' since XP, use V4xxx of PCM AND use BIG batteries in equipment...just in case.


It's like using 'sleep' mode. There seems to be a lot of threads about using it BUT no hard core necessary applications. If one 'crunches the numbers' of waking up a sleepy PIC, getting up to speed, doing 'something', then going back to sleep it's often BETTER to NOT go to sleep based on actual power used, process execution time, and cost. Also batteries lose a LOT of power when put into the cold cruel World !


Jay
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

PostPosted: Wed Mar 16, 2016 12:39 am     Reply with quote

Dears

Yes I totally agree DS3231 standby current is higher than DS1307. Because of temperature sensor on board for compensation.
When we need highly accurate RTC then we should sacrifice some other things. So in this case power.

And “temtronic” as you said 00 to 06 registers are exactly same (with only one deviation century function.), this proves I can directly use the Chip by renaming the driver and with following conditions.

With simple renaming
1. I can absolutely read/write Basic date and time functions.
Limitations
2. I should not use RAM functions after renaming
3. I can make 100% utilization if I can modify DS1307 driver
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Wed Mar 16, 2016 1:06 pm     Reply with quote

I needed better accuracy for a RTC about a year ago. Used:

<http://www.euroquartz.co.uk/news/articletype/articleview/articleid/23/new-low-power-na-current-consumption-32768khz-tcxo>

Connected to a standard DS1307.

Just fed into the crystal input of the DS. Total consumption less than 1uA.

They claim 2.67 minutes/year, but so far the unit has been within 20 seconds over the first year.
mutthunaveen



Joined: 08 Apr 2009
Posts: 100
Location: Chennai, India

View user's profile Send private message

PostPosted: Wed Mar 16, 2016 11:54 pm     Reply with quote

3231 claims less than a second accuracy per year... but it is power hungry component.

but still your precision crystal is good for the uses who need to run their chip in low power.

Thank you
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Thu Mar 17, 2016 4:13 am     Reply with quote

Er. No.

The 3231 claims 2 minutes a year. You are going to get a surprise if you expect a second a year. I suspect you have found something like an advertising 'splurge', that says something like 'in room temperature conditions will achieve 1 minute per year', and have misread second for minute.....
(worst case is 65 seconds per year in a room temperature environment).

It's 3.5PPM over full temperature range, versus 5PPM for the TXCO crystal. 2PPM if you use a restricted temperature range (the crystal goes to 3PPM over the same range).
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group