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 17:26:33 -0700
Hi Brandon,

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

Cool, glad it could help you.

If you want to learn about device drivers (albeit for 2.6) check out:

http://www.ovro.caltech.edu/~dwh/correlator/pdf/LNX-723-Hawkins.pdf
http://www.ovro.caltech.edu/~dwh/correlator/software/driver_design.tar.gz

I have written 2.4 drivers too, and probably have equivalent
versions in CVS somewhere.

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

It doesn't sound like you'll have too much trouble now that
someone has responded saying that there is an interrupt
debounce option.

Look at the parallel port IRQ handler code in the examples
above, and then hook up a toggle switch on a DIO. Once
you have that working, you can move onto key presses.

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

Just the kernel APIs.

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

Using /dev is better. You can implement the kernel poll() function
which allows the use of select(), and you can implement signal
generation (SIGIO, SIGUSR1, etc). I think the above code has
examples, if not Rubini has them.

>>> 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 don't think this is a good route for you given your time
constraints. Get the stuff above working first, and then
we can discuss this stuff.

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

Yep, hence the advice to take the simplest (but valid) route
first.

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