Bad Interupt Code

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

Line 173 is

user_routines.c 173: rc_dig_int02_ip = LOW_PRIORITY;

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.

I am using MPLAB IDE v7.50

From p18f8722.h…

extern volatile near union {
  struct {
    unsigned RBIP:1;
    unsigned **INT3P**:1;
    unsigned T0IP:1;
    unsigned INTEDG3:1;
    unsigned INTEDG2:1;
    unsigned INTEDG1:1;
    unsigned INTEDG0:1;
    unsigned NOT_RBPU:1;
  };
  struct {
    unsigned :2;
    unsigned TMR0IP:1;
    unsigned :4;
    unsigned RBPU:1;
  };
} INTCON2bits;

Looks like a typo to me.

I’ve never used that pin definition for overflow… did you try just looking up the register in the part schematic?

If you use this reference for where pins are on the part as compared to the pinout of the control board you can find that the second digital i/o pin is routed to RB3 on the microchip…

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

need anything else… hit me up with pm or email.

-q

Thank You, it was a typo. But the weird thing is that it worked with the 2005 library.

From Kevin’s encoder_readme.txt, located inside frc_encoder.zip:

  1. 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.

Maybe a different definitions file? hmm. interesting.

Well… thats why I always stay with the microchip standard names for interrupts and live by the book.

-q

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.

Remember that we are using a completely different chip then 2005, so there are several things named differently/work differently.