LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-06-2010, 01:23 AM   #1
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Rep: Reputation: 15
Lightbulb Kernel Clock running fast


Hi,

I am using AT91SAM9260 and running Linux 2.6.27 on it. Once i sync the Kernel clock and cmos clock with the reference clock and leave it for 1 day, i see a drift of nearly 8-10 sec. The kernel clock is running faster. How can i correct this?

Thanks
 
Old 07-06-2010, 03:41 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Have you double checked crystal speeds?
One way out of this messing is to use a 32.768khz crystal for your timer, if the chip allows it.
Last circuit I put out I had a spare leg somewhere and I toggled it every 0.1 secs or suchlike. Then I could scope it to deal with those problems.
 
Old 07-06-2010, 04:05 AM   #3
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by business_kid View Post
Have you double checked crystal speeds?
One way out of this messing is to use a 32.768khz crystal for your timer, if the chip allows it.
Last circuit I put out I had a spare leg somewhere and I toggled it every 0.1 secs or suchlike. Then I could scope it to deal with those problems.

I am using following

32khz:*** Epson Toyocom* MC-306.32768-A0:ROHS, Fox FSRLF327
18.432MHz: Abracon ABM3B-18.432D2W** -40C to 85C* +/-20ppm tolerance and +/-25ppm stability
 
Old 07-07-2010, 04:10 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
This goes away from software entirely. There's 86,400 seconds in a day. You are complaining about 10 of them, which is an inaccuracy of ~0.0014%
Your options are: use an ntp client & server, which fixes this in software, or slightly tweak whatever parallel capacitance you have on the crystal. Alternatively, buy a better @$£! crystal - or simply another one. Ever wonder why cheap watches don't keep time?
 
Old 07-08-2010, 02:57 AM   #5
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by business_kid View Post
This goes away from software entirely. There's 86,400 seconds in a day. You are complaining about 10 of them, which is an inaccuracy of ~0.0014%
Your options are: use an ntp client & server, which fixes this in software, or slightly tweak whatever parallel capacitance you have on the crystal. Alternatively, buy a better @$£! crystal - or simply another one. Ever wonder why cheap watches don't keep time?

I am using 18pF 5% 50V capacitor. As per the crystal oscillator it C load shall have typical value of 19pF. Is that differnece going to effect in anyway?
I am not getting your point "how the capacitance value can affect the system clock drift"?
 
Old 07-08-2010, 03:51 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
RC time constant? Usually the clock is a chip with a resonant frequency but it might be possible to be changed slightly.

Without a time standard it would be difficult to ever keep it in time. I agree that a ntp check is the best choice.
 
Old 07-08-2010, 11:23 PM   #7
ravspratapsingh
Member
 
Registered: May 2010
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jefro View Post
RC time constant? Usually the clock is a chip with a resonant frequency but it might be possible to be changed slightly.

Without a time standard it would be difficult to ever keep it in time. I agree that a ntp check is the best choice.

I agree with you that ntp is the best choice and it does work for our board. But our board is not always connected to the network, so that will create a problem. Since, we are always seeing a constant drift of 8sec/day, Is there any workaround in kernel so that we can correct the drift,say, after every 1 hour or so.
 
Old 07-09-2010, 02:41 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by ravspratapsingh View Post
I am using 18pF 5% 50V capacitor. As per the crystal oscillator it C load shall have typical value of 19pF. Is that differnece going to effect in anyway?
I am not getting your point "how the capacitance value can affect the system clock drift"?
Is it adjustable? If so, my suggestion was to tweak it. Within limits, the larger the capacitance, the slower your xtal will run.

Last edited by business_kid; 07-09-2010 at 02:44 AM.
 
Old 07-09-2010, 07:12 AM   #9
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
@ravspratapsingh

Why do you post your messages in light blue, instead of using the forum default? It just makes it harder to read.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clock running way fast? dakky21 Slackware 2 10-13-2006 04:42 AM
Clock Skew (Running Fast)... sancho Linux - Hardware 3 09-27-2006 07:25 PM
Clock Running Fast... sancho Linux - Hardware 1 08-15-2006 11:58 AM
System clock running too fast elahav Linux - Software 4 02-04-2005 07:47 PM
The clock is running too fast satimis Linux - Hardware 4 03-19-2004 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration