|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Bad Interupt Code
When I compile my interupt code with the 2007 library It gives me this error:
Code:
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 Code:
user_routines.c 173: rc_dig_int02_ip = LOW_PRIORITY; 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 |
|
#2
|
|||
|
|||
|
Re: Bad Interupt Code
From p18f8722.h.....
Code:
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;
|
|
#3
|
||||
|
||||
|
Re: Bad Interupt Code
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: Code:
INTCON2bits.INT3IP = 0; //sets RB3's interrupt to be low priority -q |
|
#4
|
|||||
|
|||||
|
Re: Bad Interupt Code
From Kevin's encoder_readme.txt, located inside frc_encoder.zip:
Quote:
Last edited by Manoel : 06-03-2007 at 19:13. Reason: 383rd post! |
|
#5
|
|||
|
|||
|
Re: Bad Interupt Code
Thank You, it was a typo. But the weird thing is that it worked with the 2005 library.
|
|
#6
|
||||
|
||||
|
Re: Bad Interupt Code
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 |
|
#7
|
|||
|
|||
|
Re: Bad Interupt Code
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.
|
|
#8
|
||||||
|
||||||
|
Re: Bad Interupt Code
Remember that we are using a completely different chip then 2005, so there are several things named differently/work differently.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading interupt pin as Standard IO | intellec7 | Programming | 8 | 16-04-2006 22:25 |
| problems using gyro/adc code with camera default code | tanstaafl | Programming | 7 | 22-01-2006 23:09 |
| Cam interupt question | Collmandoman | Programming | 8 | 24-03-2005 00:44 |
| How "bad" are motors with "bad" stickers? | cooknl | Kit & Additional Hardware | 20 | 12-01-2005 10:33 |
| interupt inconsistancy | Anthony Kesich | Programming | 1 | 21-02-2004 15:46 |