Go to Post FIRST is the best thing that has ever happened to me...FIRST has taught me so much more than anything I learned in the classroom. The thing with my team, is we are so close, we are family, and I have figured out so much about who I am because of FIRST. - princessnatalie [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-03-2007, 18:41
Ethan Reesor Ethan Reesor is offline
Registered User
FRC #0418
 
Join Date: Mar 2007
Location: Austin, TX, USA
Posts: 3
Ethan Reesor is an unknown quantity at this point
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
Line 173 is

Code:
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
  #2   Spotlight this post!  
Unread 06-03-2007, 18:50
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
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;
Looks like a typo to me.
__________________
Code:
void function(void)
 {
  function();
 }
  #3   Spotlight this post!  
Unread 06-03-2007, 18:55
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
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
need anything else... hit me up with pm or email.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #4   Spotlight this post!  
Unread 06-03-2007, 19:10
Ethan Reesor Ethan Reesor is offline
Registered User
FRC #0418
 
Join Date: Mar 2007
Location: Austin, TX, USA
Posts: 3
Ethan Reesor is an unknown quantity at this point
Re: Bad Interupt Code

Thank You, it was a typo. But the weird thing is that it worked with the 2005 library.
  #5   Spotlight this post!  
Unread 06-03-2007, 19:13
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Re: Bad Interupt Code

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

Quote:
9) 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.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383

Last edited by Manoel : 06-03-2007 at 19:13. Reason: 383rd post!
  #6   Spotlight this post!  
Unread 06-03-2007, 19:13
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
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
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #7   Spotlight this post!  
Unread 06-03-2007, 19:56
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
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.
__________________
Code:
void function(void)
 {
  function();
 }
  #8   Spotlight this post!  
Unread 06-03-2007, 21:18
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Bad Interupt Code

Quote:
Originally Posted by Jake M View Post
Either that or they changed the name of that register since 2005, which any good programmer tends not to do.
Remember that we are using a completely different chip then 2005, so there are several things named differently/work differently.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 19:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi