ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: Interrupt Handlers

To:
Subject: Re: [ts-7000] Re: Interrupt Handlers
From: "Don W. Carr" <>
Date: Thu, 14 Sep 2006 08:26:45 -0500
Another thing, if you need to have an exact number of updates every day that stay lined up with the hour, then use usleep(), and then before sleeping the next time, calculate the time you need to sleep to execute the next interval to account for the fact that the system may not wake you up at the exact time, and also processing time. That way, if you program a minute between intervals, you will always have 60 intervals per hour, some slightly shorter than a minute, and some slightly longer.

I have some code that does that if you are interested.

On 9/14/06, Matt Godbolt <> wrote:

--- In ts-7000%40yahoogroups.com, "weide72" <> wrote:
>
> I am trying to use the timer 3 interrupt running in periodic mode to
> record data every X minutes. I have set up the timer and interrupts
> correctly. When the timer reaches 0, I can tell an interrupt has
> occured but it freezes becuase I don't know how to address the
> interrupt handler that actually does the data recording properly. I
> am not sure what registers to use:
>
> VICxVectAddr, VICxDefVecAddr, VICxVectAddr0-15, and VICxVectCtrl0-15.
>
> I have looked at the GPIO's interrupt on Andy Gryc's gps_pps.tgz on
> this site but am still not getting it. Can anyone shed some light on
> this.

First up, if you need to check something every X minutes, then I'd
suggest using alarm() and/or just sleep() in a user-mode piece of code
rather than mucking about with interrupts. Unless the timing has to
be ultra-exact, or you need to take measurements very very often, it's
always easier to write and debug a user mode piece of code.

However, if you do need to write an interrupt handler, then you'll
need to acquire the interrupt, associate a handler routine with it,
and deal with it, all in a kernel module. The gps_ppz.tgz you mention
was the best tutorial I could find when I wrote an interrupt handler -
specifically what aspects do you need help with? From your email you
seem a little confused about how one sets up the interrupt vectors: In
linux you don't directly, instead linux has its own interrupt handlers
and you chain onto its list of 'interested parties' with request_irq
(http://hegel.ittc.ku.edu/topics/linux/man-pages/man9/request_irq.9.html ).
In this, the interrupt numbers are as mentioned in the Linux source
(in linux/include/asm-arm/arch-ep93xx/irqs.h), where you'll see
IRQ_TIMER3 is defined as 51.

If you're not familiar with the linux kernel architecture I recommend
you spend some time reading and understanding the gps_ppz code, it's a
well-written example of doing something similar to what you want to
achieve. However I must reiterate that it's much easier to write this
code in user space if you possibly can.




--
Dr. Don W. Carr
J. G. Montenegro 2258
Guadalajara, Mexico
+52-333-630-0704
+52-333-836-4500 ext 2930 __._,_.___


SPONSORED LINKS
Single board computer Hardware Computer running slow
Linux os Single board

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU