When I compile my interupt code with the 2007 library It gives me this error:
H:\Code\Code\user_routines.c:173:Error [1205] unknown member 'INT3IP' in '__tag_223'
H:\Code\Code\user_routines.c:173:Error [1131] type mismatch in assignment
LOW_PRIORITY is defined as 0 to set the interupt’s priority to low
rc_dig_int02_ip is defined as INTCON2bits.INT3IP based on Daniel Katanski’s paper “Interrupts for Dummies” (http://www.chiefdelphi.com/media/papers/1483).
Everything works with the interrupt on the first port, and everything everything but setting the proirity works with the second port interrupt.
All of the interrupt code worked with the 2005 library.
then if you look at the processor manual… that pin has a unique interrupt on it (unlike the second half of port b’s external interrupts)… and its priority register byte is in INTCON2, so the bit to set the pirority is “INTCON2bits.INT3IP”
here’s the line of code i suggest switching out for the one you had:
INTCON2bits.INT3IP = 0; //sets RB3's interrupt to be low priority
From Kevin’s encoder_readme.txt, located inside frc_encoder.zip:
The p18f8722.h header file included with the C18 2.4
compiler may have an error that will prevent you from
compiling this software. If you get an error like:
…Error [1205] unknown member ‘INT3IP’…
You’ll need to replace your copy of p18f8722.h with the
version included with this project. If you installed your
compiler using the default path, this file should be located
at c:\mcc18\h.
That was my first thought, that the p18f8722.h version was wrong. Either that or they changed the name of that register since 2005, which any good programmer tends not to do. That is an interesting point though. A lot of programmers would spend days of agony trying to fix it before they realized it was not their error. And here I thought professional programmers were perfect.