ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: Question about an interrupt handler and debounce

To:
Subject: Re: [ts-7000] Re: Question about an interrupt handler and debounce
From: David Hawkins <>
Date: Mon, 30 Jun 2008 12:45:34 -0700
Hi Brandon,

> I need to have the board continuously processing data from sensors 
> and hosting that information for another computer, and relative to 
> uptime, the keypad will be used very minimally, so I don't think 
> polling the keypad will work well for me. 

You might be surprised to find that polling has very low overhead.
Polling via a kernel driver, or via user-space and pthreads as
the previous poster commented, would work for you. You could
code it up, and see how much overhead it cost you.

> Also, as this is just for school, I would like to get some
> experience with interrupts, if it does not turn into too much work.  

Sure, I can understand that.

> As far as making it available to user space, I havn't worked through 
> it much but I would like to write the entered code, if correct, to a 
> file so that it can be logged.  

You want drivers to be generic, so for a keypad, the simplest
thing to do would be to have it generate read-able data in
a device node, eg.

/dev/keypad

So then something like this:

cat /dev/keypad > myfile.txt

would log the keypresses to a file.

You could then get adventurous and figure out how a keyboard
driver works, and implement your keypad as a keyboard.

> What do you mean by using the FPGA to do the debouncing?  

A keypress will cause a line to go low. A finite-state-machine
in the FPGA would be triggered on low, and then check for
transitions (bouncing), only once the line had settled into
one state (low) for a specified period (10ms) would the key
be considered pressed, and a low-output generated to the
interrupt pin on the processor. This way the FPGA filters
the junk coming from the keypad. I have some code lying around
here somewhere you can have if you want to go this route.

I'd try the simplest methods first. Get things working as fast
as possible, and then go back and polish things. You'll get
a much better mark for something that works, rather than
something that would work better ... if only you had time
to finish it.

Cheers,
Dave


------------------------------------

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