why real time clock with crystal is not accurate

Status
Not open for further replies.

polona1010

Member level 1
Joined
Apr 17, 2013
Messages
40
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,524
Why microcontroller clock is not accurate even with crystal, and why DS1307 is ok?

Why microchip and atmel dont implement RTC facility in microcontroller?
 

What do you mean "not accurate"? It's EXACTLY as accurate as your crystal.
 

Hi,

When you say crystal, are you refering to the main oscillator crystal or a 32khz used with Timer1 ?

When you say not accurate, what time variations are you experiencing and what circuitry are you using ?

Also its may sound silly, but what are you using to time it with, had one guy saying his pic timing was out but he was using his PCs clock, not a proper stopwatch.

Micropchip do implement rtc on some of the more advanced chips
 

12mhz 8mhz 20mhz for few days clock difference is few minutes to 20min.
 

Hi,

So you are using your main oscillator as the basis for a software rtc.

Assuming your hardware is good, correct capacitors etc, no details provided, then it must be a fault in your program code.

Post your code so we can see how you have done it, a hardware diagram might be useful.

Also look at this software rtc https://www.romanblack.com/one_sec.htm
 

I guess it's either a bad crystal oscillator circuit or bad code. A standard tolerance that can be easily achieved by a µP crystal oscillator is 50 - 100 ppm, corresponding to 4 - 9 seconds/day. Capacitors must be chosen according to crystal specification, however. The deviation accumulates to 0.5 - 1 hour/year, still quite a lot for a watch.

A serious reason to use a separate RTC chip is power consumption. You'll hardly achieve 0.2 - 0.5 µA with a built-in µP RTC.
 
Reactions: tpetar

    tpetar

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…