|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
help with Interrupts
Basically i learned that the PIC18 we are using has digital interrupts, how do we use them. Because so far i understand that when the digital interrupt is triggered it stops the main program and goes to address it. Where in the program or how do we specify that which interrupt should result in what procedure. If some canhelp me here it will be great
|
|
#2
|
||||
|
||||
|
The function that is called in response to an interrupt is specified in "user_routines_fast.c". If there is some interest, I could whip-up some example code that uses interrupts and timers.
-Kevin |
|
#3
|
||||
|
||||
|
For good general pointers on how to use interrupts, see IFI's white paper titled Using Polled or Interrupt-driven Timers at: http://www.innovationfirst.com/first...ite_papers.htm
It does not specifically address using the external interrupt pins (labeled INTERRUPTS on your EDU RC), but the principles for using external or internal (i.e. timer) interrupts are the same. For more information on configuring your INTERRUPTS pins for use with interrupt-driven code, read the Microchip PIC18FXX20 Data Sheet. General interrupt information is on pages 87-102. Note that by checking ifi_aliases.h you can find out the mapping of the microcontroller pins (RB2-RB7) to the INTERRUPTS pins. Specific information on these pins and their interrupts is on pages 106-108 of the data sheet. As a final note, remember that all interrupts that you use MUST be low priority. If you try to make any interrupts high priority then you will see the PROGRAM STATE LED blinking red. |
|
#4
|
|||||
|
|||||
|
PROGRAM STATE LED is red
When else can the PROGRAM STATE LED turn red? I get it sometimes when not doing anything with timers or interrupts, and haven't yet figured out why.
Stack overflow for example? Thanks, Bill Bennett |
|
#5
|
|||||
|
|||||
|
Re: PROGRAM STATE LED is red
Quote:
Invalid code did it once, sent an empty program to eduRC. Accessing an invalid ptr and making reference to it. Those are the only three I've gotten. Thanks, Ryan Waliany |
|
#6
|
||||
|
||||
|
Hey guys thnx a lot for your help, and i will love to see somw examples Kevin.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interrupts on the EDU-RC? | Andrew | Programming | 3 | 13-11-2003 23:16 |
| New Controller Specs Posted | Jnadke | Programming | 58 | 05-10-2003 08:18 |
| New Controller programmable in C | dez250 | Programming | 48 | 02-10-2003 19:28 |
| What is an interrupt handler? | Adam Y. | Programming | 7 | 14-08-2003 10:26 |
| Possible Configuration to keep things cheap | archiver | 1999 | 8 | 23-06-2002 23:03 |