Log in

View Full Version : interrupt in default code


Gal Longin
14-06-2005, 06:52
I'm sorry if such a topic already exists but i couldn't find anything about it(and i have read "Interrupts for Dummies" :confused: ).

i was trying to understand the default code and i have a few questions about using interrupts.

in the user_routines_fast.c there's a function called interrupt handler, but i can't seem to find what triggers it within the code. is there some section of the code that interrupts the regular processor activity and calls this function or does the processor do it itself. if so, is it the master processor or the user processor?

Ryan M.
14-06-2005, 07:05
The interrupt function is never directly called in the default code (and shouldn't really be in your code). In fact, it never even runs with the default code.

If you want to use the interrupt, you must enable it in user_intialization(). When the interrupt(s) you specify are triggered (such as a digital IO going high), the interrupt handler is run.

Of course, I never got them to work, so... :D

Mike Betts
14-06-2005, 09:01
Gal,

I strongly suggest that you download http://kevin.org/frc/frc_interrupts.zip to get a fast understanding of interrupts.

Mike

Athena
04-02-2006, 13:55
Uhhh....the hyperlink isnt working. anyways. We are having problems with our interrupts as well. i just tried to enable them, and nothing happens. does somebody have any suggestions? :confused:

Mike Betts
04-02-2006, 19:49
Uhhh....the hyperlink isnt working. anyways. We are having problems with our interrupts as well. i just tried to enable them, and nothing happens. does somebody have any suggestions? :confused:

Athena,

Kevin moved that file here (http://kevin.org/frc/2005/frc_interrupts.zip) to make room for the 2006 stuff. Although you can not compile and run directly on the 2006 RC (the uP changed) the basics have not changed and certainly you can cut and paste into your 2006 code.

After looking it over, please post any specific questions and I will try and answer them.

Mike

Andrew Blair
04-02-2006, 20:10
Kevin's code really is wonderful. Its really well commented. In fact, I'm using it right now to write our code. I can't recommend it enough.