This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: to consume cpu time
- From: Doug Fraser <dfraser at photuris dot com>
- To: 'Nick Garnett' <nickg at ecoscentric dot com>, Luca Formaggio <luca_formaggio at yahoo dot it>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Wed, 22 Oct 2003 11:15:08 -0400
- Subject: RE: [ECOS] to consume cpu time
One method of forcing nanosecond delays that I have
used is to read from FLASH. It is usually not cached
(to avoid programming problems) and also responds
in fixed time to a read cycle for most hardware.
For example, on our MPC850 based hardware, a FLASH
read (Intel Strata) responds in exactly 150nS.
You can get very consistent delay loops this way.
Doug Fraser
> -----Original Message-----
> From: Nick Garnett [mailto:nickg@ecoscentric.com]
> Sent: Wednesday, October 22, 2003 6:17 AM
> To: Luca Formaggio
> Cc: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] to consume cpu time
>
>
> Luca Formaggio <luca_formaggio@yahoo.it> writes:
>
> > Hi. I need to consume a cpu time in a program. This
> > time is in nanoseconds. Is there a ecos function that
> > consume time in nanoseconds? If it exists, how I call
> > this function from my program?
>
> There's nothing in eCos that can handle that. The best we have is
> HAL_DELAY_US() which approximates a given microsecond delay.
>
> If you want to insert delays for sub-microsecond periods then the best
> approach is probably to use timed code loops. Even then, your timing
> is going to be thrown out by any interupts. Even cache misses or DRAM
> refresh cycles may affect you.
>
> --
> Nick Garnett eCos Kernel Architect
> http://www.ecoscentric.com The eCos and RedBoot experts
>
>
> --
> Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss