ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: Interrupt of TS7200 DIO pin 8 [port F bit 1]

To:
Subject: Re: [ts-7000] Re: Interrupt of TS7200 DIO pin 8 [port F bit 1]
From: Fotis Loukos <>
Date: Sat, 22 Dec 2007 21:42:40 +0200
yaco2k wrote:
> --- In  Jim Jackson <> wrote:
>> This looks like a userspace program. AFAIK you can only do interupt
>> handling in the Kernel, using a suitable kernel driver.
>>
>> Why don't you just poll and forget interrupts?
> 
> thanx Jim for your replay.. 
> 
> polling wont be efficient for my mobile application especialy in terms 
> of power consumption so i am trying to make the interrupt thing work 
> and i've been searching for more than two weeks but resourses about 
> interrupts in TS7200 are raely small.
> 
> I think i opened the registers to the user space by setting the 
> protection registers of the VIC to 0x0 and I used :
> 
> int fd = open("/dev/mem", O_RDWR|O_SYNC);
> vic = (unsigned int *)mmap(0, getpagesize(), 
>         PROT_READ|PROT_WRITE, MAP_SHARED, fd, vic_baddr);
> 
> in my code.
> 
> even though I still agree with you that user space could be the 
> problem, so plz if u have any toturials or sample code of a kernal 
> driver plz send it to me and i'll try to change this code into a 
> kernal driver.
> 
> Thanx...
> 
> 
> 

Doing interrupt handling in userland isn't possible at least in linux.
Even by setting the right registers, like you did at your program, won't
help you. Imagine creating an interrupt handler in a program which later
gets swapped to the disk!
The kernel driver solution will help you handle interrupts. There is an
online version of the third edition of "Linux Device Drivers" at
http://lwn.net/Kernel/LDD3/ which covers kernel version 2.6 and the
second edition at http://lwn.net/Kernel/LDD2/ which covers kernel
version 2.4. There is a whole chapter about interrupt handling at both
editions and how you can write drivers like the one you want.
But, since you have a very specific application you could try another os
like ecos. I believe it will be much easier to create an interrupt
handler with ecos than to create a linux kernel driver. It isn't
difficult to learn it and it is very good for embedded applications. Of
course you won't have the option to run other things there like an
apache server if you want to serve web content!

Fotis


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<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