public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "M Arshad Khan" <marshadkhan@gmail.com>
To: "M Arshad Khan" <marshadkhan@gmail.com>,
	ecos-discuss@ecos.sourceware.org,
	 	ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Drift in Real Time Clock
Date: Wed, 06 Jun 2007 10:33:00 -0000	[thread overview]
Message-ID: <4690b0d10706060251nfb2c3a0o4f681317413e9616@mail.gmail.com> (raw)
In-Reply-To: <20070605123137.GA12951@lunn.ch>

On 6/5/07, Andrew Lunn <andrew@lunn.ch> wrote:
> 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
>
yes the problem was with the initialization value i varry this value
and got delay of 1.5ms in 100 s using initialization value of 11934
(very strange...). now i want to reduce the time of one tick from 10ms
to 1ms... so that i can generate interrupt of 1ms i tried it by
changing the values of clock resolution numerator and clock resolution
denominator but same 10ms. any suggestion in this regard?...

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

WARNING: multiple messages have this Message-ID
From: "M Arshad Khan" <marshadkhan@gmail.com>
To: "M Arshad Khan" <marshadkhan@gmail.com>,
	ecos-discuss@ecos.sourceware.org,
	 	ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Drift in Real Time Clock
Date: Wed, 06 Jun 2007 10:37:00 -0000	[thread overview]
Message-ID: <4690b0d10706060251nfb2c3a0o4f681317413e9616@mail.gmail.com> (raw)
Message-ID: <20070606103700.2kvfO8zfd27aZv-pXjbc1iSOMDegsT3y7qkVN4pbKA0@z> (raw)
In-Reply-To: <20070605123137.GA12951@lunn.ch>

On 6/5/07, Andrew Lunn <andrew@lunn.ch> wrote:
> 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
>
yes the problem was with the initialization value i varry this value
and got delay of 1.5ms in 100 s using initialization value of 11934
(very strange...). now i want to reduce the time of one tick from 10ms
to 1ms... so that i can generate interrupt of 1ms i tried it by
changing the values of clock resolution numerator and clock resolution
denominator but same 10ms. any suggestion in this regard?...

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  parent reply	other threads:[~2007-06-06  9:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05  4:59 M Arshad Khan
2007-06-05 12:31 ` M Arshad Khan
2007-06-05 17:49 ` Andrew Lunn
2007-06-05 18:31   ` Andrew Lunn
2007-06-06 10:33   ` M Arshad Khan [this message]
2007-06-06 10:37     ` M Arshad Khan
2007-06-06 12:20     ` Nick Garnett
2007-06-06 14:29       ` Nick Garnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4690b0d10706060251nfb2c3a0o4f681317413e9616@mail.gmail.com \
    --to=marshadkhan@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).