ts-7000
[Top] [All Lists]

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

To:
Subject: [ts-7000] Re: Question about an interrupt handler and debounce
From: "bdon003" <>
Date: Mon, 30 Jun 2008 23:25:31 -0000
Dave,

     Thanks for your quick responses and help, I'd also like to say
thanks for making your ts-7300 analysis work available at
www.ovro.caltech.edu/~dwh/ts7300/ts7300.pdf I found it really useful
when I first got the board and was experimenting with it.  I used your
work from there to get a cross-compiler working and a NFS share setup.



> > 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.
>


I would like to do that, whether for my project or afterwords just to
experiment with it.  My goal was to have this driver completed by the
beginning of classes mid-August, so I need to see how much I can get done.


 
> > 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.
> 


That's what I was thinking.  Well except make a /proc entry for that
purpose, is there any difference?  Is there a way that I could signal
my user-space program to run that command, say when the entered code
reaches four characters, so I would not have to constantly poll it for
changes?



> > 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.


That might be a very good route for me.  I have been trying to decide
how to use the FPGA, right now the plan is to only use it for its
extra GPIO.  I have not gotten into the workings of the FPGA with the
board yet, does the FPGA implement a memory controller for its RAM,
which holds the DR and DDR registers for the GPIO pins?  If I came up
with my FSM, would I need to also implement some kind of memory
controller to make use of the GPIO?  I will try and come up with my
own code for the FSM at least, but I'd love to see what you have
afterwords to see how I could have done it better.  


> 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
>


That is what happens to a lot of teams at my school.  I believe it has
been awhile since a team has gotten a micro-controller to work
properly.  I plan to break that.  As our project manager, I've already
had to learn to say no to good ideas because they change too much of
what we already had, and I anticipate everyone slacking a least a
little bit due to it being our last semester.  

Thanks,
Brandon


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

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