This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: timer -> interrupt


On Fri, Oct 22, 2004 at 05:07:32PM +0200, Sicheri Marco wrote:
> I All,
> I need to create a timer that cause an interrupt.
> Oh yes, the cyg_alarm_xxx work fine! But the resolution (tick) isn't
> sufficient... :o(
> My timer must count and each 100us (time between 100us and 800us) cause a
> interrupt, so that my interrupt routine can work.
> How can i do it?
> Normaly I programming the CPU registers with time and interupt vector. But
> in eCos: How do i do?

Reading the manual is normally a good start.

http://ecos.sourceware.org/docs-latest/

You need to add an interrupt handling function using the
cyg_interrupt_*() functions. Then program one of the spare hardware
timer to generate interrupts at the rate you need. You have a few
choices how you handle the interrupt after that.

You could instantiate a new counter object. Your DSR routine then
calls the counters tick function. You can then use this new counter
object with the normal cyg_alarm_*() functions to give high accuracy
alarms.

You your DSR function could do all you need.

        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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]