View Single Post
  #7   Spotlight this post!  
Unread 22-12-2003, 14:04
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Optical Encoders

Quote:
Originally Posted by misterikkit
So wait, I don't quite understand how to use interrupts. Are those macros you're using to refer to interrupt pins?
No, I'm manipulating the memory-mapped bits directly. The bits are defined in ifi_picdefs.h.


Quote:
Originally Posted by misterikkit
Do I have to write code that invokes the handler?
No, that's one of the cool things about interrupts: The hardware executes your code in the interrupt handler automatically when some event happens (e.g., a timer rolls-over or an interrupt pin changes from a 0 to a 1).
What you do need to do is configure the interrupt hardware so it knows how to behave (e.g., interrupt on the rising-edge or falling-edge of the signal on the interrupt pin). Have a look at the interrupt initialization routines for a description of the various ways to configure an interrupt. Also have a look at user_routines_fast.c because this is where the interrupt handlers are mapped to the different types of interrupts.

My goal is to get folks using interrupts, so if you have additional questions, ask away.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org