View Single Post
  #12   Spotlight this post!  
Unread 08-12-2003, 12:17
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: IFI_Initialization

Quote:
Originally Posted by Andrew
There also appears to be an interrupt service routine for the low priority interrupt and which can be executed using the 6 digital input pins on the front of the EDU-RC, labelled "Interrupt."

This code would execute whenever a transition (low-to-high, I think) is initiated on one of those pins.

In embedded, interrupt driven code you have to give up the notion of step-by-step execution. Multiple programs can be running simultaneously and which interact with each other.
Just to clarify on the interrupts.

There are a total of 8 input pins on the pic that trigger interrupts. In the low priority int handler routine they give us, we only have access to 6 of them, and since there are only 6 pins, I'm assuming they use int0 and int1 for other purposes.

4 of the 8 interrupt pins (B0-B3) interrupt on either a rising edge or a falling edge (not both), and you can select between the two using the appropriate INTCON. The other 4 (B4-B7) trigger an interrupt on change, rising or falling (both). There is only 1 flag assossiated with all 4 pins, so if the interrupt triggers you need to compare the current state of all 4 pins to the state before the interrupt to figure out which one changed.

I'm pretty sure pin 1 of the interrupts is connected to port B pin 2, pin 2 to port B pin 3, etc down the line, so the last 4 are the interrupt on change pins.