public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] timer
@ 2001-05-15  4:29 mekala natarajan
  2001-05-15  5:39 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: mekala natarajan @ 2001-05-15  4:29 UTC (permalink / raw)
  To: ecos-discuss

Can someone tell me the timer chip(and clock
frequency) that is used in MBX kit. 

(eg.,For i386 pc target, the timer chip is 8254 whose
clock frequency is 1193180HZ, from which we derive at
the kernel clock of 10ms.)

Basically i want to run my application within a time
frame of 2ms(which is less than a tick).Within this
2ms frame, i need to get the current time at various
points of the frame which will be in terms of
microseconds.But ecos get current time system call
will return time in terms of ticks. For this to happen
i reduced the tick resolution to 500us. But with this
configuration performance is degrading, since most of
time is getting wasted in processing the interrupt.

Now i don't want to use the kernel clock.

How can i solve this problem. 

Can i directly access the timer chip and derive the 
desired periodicity from this.

Is this possible?

If yes.How can i do this?

Regards,
mekala



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] timer
  2001-05-15  4:29 [ECOS] timer mekala natarajan
@ 2001-05-15  5:39 ` Gary Thomas
  2001-05-17  5:18   ` mekala natarajan
  0 siblings, 1 reply; 8+ messages in thread
From: Gary Thomas @ 2001-05-15  5:39 UTC (permalink / raw)
  To: mekala natarajan; +Cc: ecos-discuss

On 15-May-2001 mekala natarajan wrote:
> Can someone tell me the timer chip(and clock
> frequency) that is used in MBX kit. 
> 
> (eg.,For i386 pc target, the timer chip is 8254 whose
> clock frequency is 1193180HZ, from which we derive at
> the kernel clock of 10ms.)
> 
> Basically i want to run my application within a time
> frame of 2ms(which is less than a tick).Within this
> 2ms frame, i need to get the current time at various
> points of the frame which will be in terms of
> microseconds.But ecos get current time system call
> will return time in terms of ticks. For this to happen
> i reduced the tick resolution to 500us. But with this
> configuration performance is degrading, since most of
> time is getting wasted in processing the interrupt.
> 
> Now i don't want to use the kernel clock.
> 
> How can i solve this problem. 
> 
> Can i directly access the timer chip and derive the 
> desired periodicity from this.
> 
> Is this possible?
> 
> If yes.How can i do this?
> 

The HAL_CLOCK_READ() will get you just what you want.  It will
return the time (in hardware clock ticks) since the last system
clock timer interrupt.  Thus it is a measure of time within the
current "tick" (heartbeat). You can easily convert the value 
returned into us or ms.

Look at 'kernel/current/tests/tm_basic.cxx' for examples of how
to use it and how to convert the result into common units.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] timer
  2001-05-15  5:39 ` Gary Thomas
@ 2001-05-17  5:18   ` mekala natarajan
  2001-05-17  6:50     ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: mekala natarajan @ 2001-05-17  5:18 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

Hi,
  I tried running the intr.c(from tests)program HAL
interrupt API test.

I disabled the provide real time clock option.

This is the output which i get

PASS: Hal interrupt test
EXIT: OK

The isr routine is not getting called.

I am using MBX 860 as my target.

Regards,
mekala





--- Gary Thomas <gthomas@cambridge.redhat.com> wrote:
> 
> On 15-May-2001 mekala natarajan wrote:
> > Can someone tell me the timer chip(and clock
> > frequency) that is used in MBX kit. 
> > 
> > (eg.,For i386 pc target, the timer chip is 8254
> whose
> > clock frequency is 1193180HZ, from which we derive
> at
> > the kernel clock of 10ms.)
> > 
> > Basically i want to run my application within a
> time
> > frame of 2ms(which is less than a tick).Within
> this
> > 2ms frame, i need to get the current time at
> various
> > points of the frame which will be in terms of
> > microseconds.But ecos get current time system call
> > will return time in terms of ticks. For this to
> happen
> > i reduced the tick resolution to 500us. But with
> this
> > configuration performance is degrading, since most
> of
> > time is getting wasted in processing the
> interrupt.
> > 
> > Now i don't want to use the kernel clock.
> > 
> > How can i solve this problem. 
> > 
> > Can i directly access the timer chip and derive
> the 
> > desired periodicity from this.
> > 
> > Is this possible?
> > 
> > If yes.How can i do this?
> > 
> 
> The HAL_CLOCK_READ() will get you just what you
> want.  It will
> return the time (in hardware clock ticks) since the
> last system
> clock timer interrupt.  Thus it is a measure of time
> within the
> current "tick" (heartbeat). You can easily convert
> the value 
> returned into us or ms.
> 
> Look at 'kernel/current/tests/tm_basic.cxx' for
> examples of how
> to use it and how to convert the result into common
units.


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] timer
  2001-05-17  5:18   ` mekala natarajan
@ 2001-05-17  6:50     ` Gary Thomas
  0 siblings, 0 replies; 8+ messages in thread
From: Gary Thomas @ 2001-05-17  6:50 UTC (permalink / raw)
  To: mekala natarajan; +Cc: ecos-discuss

On 17-May-2001 mekala natarajan wrote:
> Hi,
>   I tried running the intr.c(from tests)program HAL
> interrupt API test.
> 
> I disabled the provide real time clock option.
> 
> This is the output which i get
> 
> PASS: Hal interrupt test
> EXIT: OK
> 
> The isr routine is not getting called.

It has to be - that's the only way the test can pass.

> 
> I am using MBX 860 as my target.
> 

What does any of this have to do with your question below?

> Regards,
> mekala
> 
> 
> 
> 
> 
> --- Gary Thomas <gthomas@cambridge.redhat.com> wrote:
>> 
>> On 15-May-2001 mekala natarajan wrote:
>> > Can someone tell me the timer chip(and clock
>> > frequency) that is used in MBX kit. 
>> > 
>> > (eg.,For i386 pc target, the timer chip is 8254
>> whose
>> > clock frequency is 1193180HZ, from which we derive
>> at
>> > the kernel clock of 10ms.)
>> > 
>> > Basically i want to run my application within a
>> time
>> > frame of 2ms(which is less than a tick).Within
>> this
>> > 2ms frame, i need to get the current time at
>> various
>> > points of the frame which will be in terms of
>> > microseconds.But ecos get current time system call
>> > will return time in terms of ticks. For this to
>> happen
>> > i reduced the tick resolution to 500us. But with
>> this
>> > configuration performance is degrading, since most
>> of
>> > time is getting wasted in processing the
>> interrupt.
>> > 
>> > Now i don't want to use the kernel clock.
>> > 
>> > How can i solve this problem. 
>> > 
>> > Can i directly access the timer chip and derive
>> the 
>> > desired periodicity from this.
>> > 
>> > Is this possible?
>> > 
>> > If yes.How can i do this?
>> > 
>> 
>> The HAL_CLOCK_READ() will get you just what you
>> want.  It will
>> return the time (in hardware clock ticks) since the
>> last system
>> clock timer interrupt.  Thus it is a measure of time
>> within the
>> current "tick" (heartbeat). You can easily convert
>> the value 
>> returned into us or ms.
>> 
>> Look at 'kernel/current/tests/tm_basic.cxx' for
>> examples of how
>> to use it and how to convert the result into common
> units.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Timer
  2004-12-02 16:35 ` David N. Welton
@ 2004-12-02 16:39   ` Wayne Gemmell
  0 siblings, 0 replies; 8+ messages in thread
From: Wayne Gemmell @ 2004-12-02 16:39 UTC (permalink / raw)
  To: ecos-discuss

Thanks guys, I'll look over those...


On Thursday 02 December 2004 18:33, David N. Welton wrote:
> Wayne Gemmell <wayneg@ananzi.co.za> writes:
> > Hi all
> >
> > Heres a real C/C++ newbie question. How do I implement a timer? The
> > header file is timer.hxx and when I include it into my C code I get many
> > errors. Could anyone shed some light?
>
> You might consider this book, which afaik, has a free version on line.
> It covers a lot of the 'newbie' type stuff in eCos pretty well.
>
> http://www.amazon.com/exec/obidos/tg/detail/-/0130354732/qid=1102005282/sr=
>8-2/ref=pd_csp_2/002-1602023-4776812?v=glance&s=books&n=507846
>
> --
> David N. Welton
> Personal:                   http://www.dedasys.com/davidw/
> Apache Tcl:                 http://tcl.apache.org/
> Free Software:              http://www.dedasys.com/freesoftware/
> Linux Incompatibility List: http://www.leenooks.com/

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Timer
  2004-12-02 16:28 [ECOS] Timer Wayne Gemmell
  2004-12-02 16:34 ` Andrew Lunn
@ 2004-12-02 16:35 ` David N. Welton
  2004-12-02 16:39   ` Wayne Gemmell
  1 sibling, 1 reply; 8+ messages in thread
From: David N. Welton @ 2004-12-02 16:35 UTC (permalink / raw)
  To: wayneg; +Cc: ecos-discuss

Wayne Gemmell <wayneg@ananzi.co.za> writes:

> Hi all
> 
> Heres a real C/C++ newbie question. How do I implement a timer? The header 
> file is timer.hxx and when I include it into my C code I get many errors. 
> Could anyone shed some light?

You might consider this book, which afaik, has a free version on line.
It covers a lot of the 'newbie' type stuff in eCos pretty well.

http://www.amazon.com/exec/obidos/tg/detail/-/0130354732/qid=1102005282/sr=8-2/ref=pd_csp_2/002-1602023-4776812?v=glance&s=books&n=507846

-- 
David N. Welton
Personal:                   http://www.dedasys.com/davidw/
Apache Tcl:                 http://tcl.apache.org/
Free Software:              http://www.dedasys.com/freesoftware/
Linux Incompatibility List: http://www.leenooks.com/

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Timer
  2004-12-02 16:28 [ECOS] Timer Wayne Gemmell
@ 2004-12-02 16:34 ` Andrew Lunn
  2004-12-02 16:35 ` David N. Welton
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2004-12-02 16:34 UTC (permalink / raw)
  To: Wayne Gemmell; +Cc: ecos-discuss

On Thu, Dec 02, 2004 at 06:28:12PM +0200, Wayne Gemmell wrote:
> Hi all
> 
> Heres a real C/C++ newbie question. How do I implement a timer? The header 
> file is timer.hxx and when I include it into my C code I get many errors. 
> Could anyone shed some light?

See the example program simple-alarm.c. You can find it in cvs, eg

http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/ecos/examples/simple-alarm.c?rev=1.3&content-type=text/plain&cvsroot=ecos
        
        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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ECOS] Timer
@ 2004-12-02 16:28 Wayne Gemmell
  2004-12-02 16:34 ` Andrew Lunn
  2004-12-02 16:35 ` David N. Welton
  0 siblings, 2 replies; 8+ messages in thread
From: Wayne Gemmell @ 2004-12-02 16:28 UTC (permalink / raw)
  To: ecos-discuss

Hi all

Heres a real C/C++ newbie question. How do I implement a timer? The header 
file is timer.hxx and when I include it into my C code I get many errors. 
Could anyone shed some light?

Cheers
Wayne

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-12-02 16:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-15  4:29 [ECOS] timer mekala natarajan
2001-05-15  5:39 ` Gary Thomas
2001-05-17  5:18   ` mekala natarajan
2001-05-17  6:50     ` Gary Thomas
2004-12-02 16:28 [ECOS] Timer Wayne Gemmell
2004-12-02 16:34 ` Andrew Lunn
2004-12-02 16:35 ` David N. Welton
2004-12-02 16:39   ` Wayne Gemmell

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).