From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23063 invoked by alias); 5 Jun 2007 12:31:44 -0000 Received: (qmail 23053 invoked by uid 22791); 5 Jun 2007 12:31:43 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Jun 2007 12:31:41 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1HvYCH-00068T-00; Tue, 05 Jun 2007 14:31:37 +0200 Date: Tue, 05 Jun 2007 17:49:00 -0000 To: M Arshad Khan Cc: ecos-discuss@ecos.sourceware.org, ecos-discuss@sources.redhat.com Message-ID: <20070605123137.GA12951@lunn.ch> Mail-Followup-To: M Arshad Khan , ecos-discuss@ecos.sourceware.org, ecos-discuss@sources.redhat.com References: <4690b0d10706042159k40c3e12cp7e92a4a4cb66d2b0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4690b0d10706042159k40c3e12cp7e92a4a4cb66d2b0@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Drift in Real Time Clock X-SW-Source: 2007-06/txt/msg00055.txt.bz2 On Tue, Jun 05, 2007 at 09:59:21AM +0500, M Arshad Khan wrote: > Hello > we r running eCos on simple intel based PC. we want to find the drift > in the real time colck, for this we simply capture a 100Sec signal > using 20mSec interrupt. the signal was captured using a counter by > triggering the channel of the counter using parallel port of the PC. > the code is given below. > from the results we found that the drift was 7mili Sec in 100 Sec. > This drift is very large to fitt for real time colck. we also tried > this code on different PC's but app same results. can any body tell me > why i am getting so much drift... > any suggestions.. > I believe the PC clock ticks at a base rate of 1193182Hz. The eCos clock is usually configured for 10ms. That would be 11931.82 ticks. Obviously you cannot have fractional ticks, so you end up with 11932 ticks per 10ms. The error is then 0.0015%. 0.0015% of 100Sec = 0.0015seconds i.e. 1.5ms. So something is not right somewhere, but i think you get the idea. Check i have the clock frequency correct and perform your own calculation about what accuracy is achievable. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23662 invoked by alias); 5 Jun 2007 12:31:50 -0000 Received: (qmail 23590 invoked by uid 22791); 5 Jun 2007 12:31:49 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Jun 2007 12:31:46 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1HvYCH-00068T-00; Tue, 05 Jun 2007 14:31:37 +0200 Date: Tue, 05 Jun 2007 18:31:00 -0000 To: M Arshad Khan Cc: ecos-discuss@ecos.sourceware.org, ecos-discuss@sources.redhat.com Message-ID: <20070605123137.GA12951@lunn.ch> Mail-Followup-To: M Arshad Khan , ecos-discuss@ecos.sourceware.org, ecos-discuss@sources.redhat.com References: <4690b0d10706042159k40c3e12cp7e92a4a4cb66d2b0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4690b0d10706042159k40c3e12cp7e92a4a4cb66d2b0@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Drift in Real Time Clock X-SW-Source: 2007-06/txt/msg00056.txt.bz2 Message-ID: <20070605183100.2aFpm7SLK7cysfLDN4Z05Bq0pwHe4F-SnaxzpNDb9wQ@z> On Tue, Jun 05, 2007 at 09:59:21AM +0500, M Arshad Khan wrote: > Hello > we r running eCos on simple intel based PC. we want to find the drift > in the real time colck, for this we simply capture a 100Sec signal > using 20mSec interrupt. the signal was captured using a counter by > triggering the channel of the counter using parallel port of the PC. > the code is given below. > from the results we found that the drift was 7mili Sec in 100 Sec. > This drift is very large to fitt for real time colck. we also tried > this code on different PC's but app same results. can any body tell me > why i am getting so much drift... > any suggestions.. > I believe the PC clock ticks at a base rate of 1193182Hz. The eCos clock is usually configured for 10ms. That would be 11931.82 ticks. Obviously you cannot have fractional ticks, so you end up with 11932 ticks per 10ms. The error is then 0.0015%. 0.0015% of 100Sec = 0.0015seconds i.e. 1.5ms. So something is not right somewhere, but i think you get the idea. Check i have the clock frequency correct and perform your own calculation about what accuracy is achievable. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss