ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: How to use the timer interrupt???????

To:
Subject: Re: [ts-7000] Re: How to use the timer interrupt???????
From: "Rich Wilson" <>
Date: Mon, 5 Jan 2009 15:16:39 -0800
I don't know what you want help with.
I believe that your original program is hopelessly misdirected and doomed to failure.
You can't intercept interrupts from user code. The closest I know of is using the "setitimer" and "signal" functions to have a kernel timer give you a signal. If that isn't good enough, you need to write your own kernel module.
You should probably start over, specify exactly what it is you wish to accomplish, and ask for help on how to do that.

Rich

On Thu, Jan 1, 2009 at 8:08 PM, anadigpune <> wrote:

Hi Rich,
Thanks for your help, but I have tried the same program on Timer 2,
3 and 64Hz interrupt. But none of them is working. the only error it
shows is the typecasting error for the following line.

*VIC1VectAddr0 = (unsigned int *)Timer;

will this help you to help me?



--- In ts-7000%40yahoogroups.com, "Rich Wilson" <> wrote:
>
> I suspect that when you're running linux, you can't expect to
service a
> hardware interrupt in user space.
> Someone please correct me if I'm wrong.
> Also, if I'm not mistaken, timer 1 is used by the kernel, and if
you fiddle
> with
> it, you can expect no good to come of it.
>
> I'm currently working on an interrupt-driven project, and I'm
using the code
> from
> the file
gps_pps.tgz<http://f1.grp.yahoofs.com/v1/sDFcSaojrTkP3_CPSeWd4SkOPBLp
RvUc91RWI8GYHJx9oZGPR5HSr51zb4ktfSfaPoqBpw_sp_2mxekxqMZA0KMXvZJwQw/Ex
ample%20Code/gps_pps.tgz>

> from the files/example code area of the group as a template.
> This shows how to write a kernel module which handles interrupts.
>
> Rich
>
> On Mon, Dec 29, 2008 at 1:25 AM, anadigpune <> wrote:
>
> > Dear All,
> > I am using TS-TPC-7390 SBC with the Ecllipse IDE.
> > Can anyone tell me how to use the timer interrupt with Ecllipse
IDE.
> > I am posting what ever code i have written, but my code hangs
> > whenever the interrupt occurs.
> >
> > void Timer(void) __attribute__ ((interrupt("IRQ")));
> >
> > void main(void)
> > {
> > unsigned char *start;
> >
> > int fd = open("/dev/mem", O_RDWR|O_SYNC);
> > start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED,
> > fd, 0x80840000);
> > PEDR = (unsigned int *)(start + 0x20); // port e data
> > PEDDR = (unsigned int *)(start + 0x24); // port e dir reg
> >
> > start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED,
> > fd, 0x80810000);
> > T1LOAD = (unsigned int *)(start + 0x00);
> > T1VAL = (unsigned int *)(start + 0x04);
> > T1CTRL = (unsigned int *)(start + 0x08);
> > TC1EOI = (unsigned int *)(start + 0x0C);
> >
> > start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED,
> > fd, 0x800B0000);
> > VIC1IntEnClear = (unsigned int *)(start + 0x14);
> > VIC1IntEnable = (unsigned int *)(start + 0x10);
> > VIC1VectAddr0 = (unsigned int *)(start + 0x100);
> > VIC1VectCntl0 = (unsigned int *)(start + 0x200);
> >
> > *PEDDR = 0xff;
> > *PEDR = 0x00;
> >
> > *T1LOAD = 0x07D0;
> > *T1CTRL = 0x0C;
> >
> > *VIC1IntEnClear = 0x07F7FFFF;
> > *VIC1VectAddr0 = (unsigned int *)Timer;
> > *VIC1VectCntl0 = 0x20 | 4;
> > *VIC1IntEnable = 0x10;
> > .
> > .
> > close(fd);
> > }
> > void Timer(void)
> > {
> > *TC1EOI = 0x04;
> > *PEDR = 0xff;
> > sleep(2);
> > *PEDR = 0x00;
> > }
> >
> >
> >
>
>
>
> --
> Rich Wilson
>




--
Rich Wilson

425-374-4760
425-337-7129
__._,_.___

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