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 CCS Technical Support

rtc chip

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



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

rtc chip
PostPosted: Sat Apr 11, 2020 5:30 am     Reply with quote

What can you suggest for the rtc integration that does not deviate.
_________________
Es
temtronic



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

View user's profile Send private message

PostPosted: Sat Apr 11, 2020 5:50 am     Reply with quote

I use the DS3231, on a premade module that also has a small EEPROM and battery holder. Cost about $2 CDN. I can't buy the parts for that price !

I have 5-6 in use around here, mainly Greenhouse projects. I use the 1Hz interrupt function as 'trigger,' updating the LCD module, reading DS18B20 sensors, sending data, etc.

The DS3231 also has a builtin temperature sensor, ok for 'rough' temperature. Also has 7(?) bytes of battery backed RAM.


Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Sat Apr 11, 2020 7:22 am     Reply with quote

Unless you use something like a GPS or network synchronised clock,
all RTC's are all going to 'deviate'. However some by less than others.
Temperature compensated oscillators like the DS3231 give a guaranteed
accuracy in the order of a minute a year.
A normal RTC based on a watch crystal, if you 'hand tune' the oscillator,
and if kept at a reasonably stable temperature can manage within perhaps
a couple of minutes a year. Build though with no tuning, and an off
the shelf crystal, and it is easy to find yourself with many times this error.
I use the DS1338C on quite a few units, and this has the advantage that the
oscillator is internal and pre-calibrated. Easily manages better than 5 minutes
a year.
I have a clock here built as a calibration source. Uses a 100KHz crystal, in
a temperature regulated over. Then synchronises this to the MSF
transmissions including built in correction for the distance I am from this
transmitter.
Gives me a frequency source guaranteed to be within a very few PPB, and
time that is basically 'atomic' in accuracy. However this involves many
hundred of parts. Conversely have lots of boards with normal RTC's and
these are very unlikely to be far from the actual time, and involve
instead a few dollars of parts....
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

PostPosted: Sat Apr 11, 2020 7:40 am     Reply with quote

I think it supports as ccs c ds1338.c driver. Is there a difference from its use to ds1302?
_________________
Es
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Sat Apr 11, 2020 8:00 am     Reply with quote

I've put a DS1338.c driver into the code library.
temtronic



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

View user's profile Send private message

PostPosted: Sat Apr 11, 2020 8:44 am     Reply with quote

I've modified the DS1307 driver for the DS3231, though it doesn't use all the functions of the 3231 RTC, like alarms.
I got it to work for me and didn't see the need to make a complete driver.
There maybe be a complete driver in the code library, though I've never checked.
The DS3231 is popular, several PCBs have EEPROM as well. While I tested the EEPROM function on mine, again, never used it but... at $2 a board, a nice feature for future projects.
More important to spread 5 cubic meters of chicken compost onto the garden...sigh.... anyone need some 'upper body exercise' ??
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