Go to Post Think of the build season as kiddie bowling. Mentors should be the bumpers and your mom who lines you up and gives you advice. - Joe Matt [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 31-01-2008, 13:44
cprogrammer's Avatar
cprogrammer cprogrammer is offline
Registered User
FRC #1595 (Gremlins)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Washington
Posts: 42
cprogrammer will become famous soon enoughcprogrammer will become famous soon enough
Ganged Interrupt Edge Detection

Do Interrupts on the RB Port (Ganged Interrupts) have any edge detection registry assignments?
  #2   Spotlight this post!  
Unread 31-01-2008, 13:53
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Ganged Interrupt Edge Detection

Quote:
Originally Posted by cprogrammer View Post
Do Interrupts on the RB Port (Ganged Interrupts) have any edge detection registry assignments?
If enabled, all four fire off on both edges. If you are interested in executing an ISR on only one edge, just examine the state of the pin in the ISR and execute your code only when it is at the right logic level (e.g., if it's a one, a rising edge just happened). If you're using my code, I pass the logic level into the ISR for you.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 31-01-2008, 18:11
cprogrammer's Avatar
cprogrammer cprogrammer is offline
Registered User
FRC #1595 (Gremlins)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Washington
Posts: 42
cprogrammer will become famous soon enoughcprogrammer will become famous soon enough
Re: Ganged Interrupt Edge Detection

Quote:
If enabled, all four fire off on both edges. If you are interested in executing an ISR on only one edge, just examine the state of the pin in the ISR and execute your code only when it is at the right logic level (e.g., if it's a one, a rising edge just happened). If you're using my code, I pass the logic level into the ISR for you.

-Kevin
How should I go about reading that logic level?
-Stephen
  #4   Spotlight this post!  
Unread 31-01-2008, 18:45
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Ganged Interrupt Edge Detection

Quote:
(e.g., if it's a one, a rising edge just happened)
That just means 1 or 0 basically
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #5   Spotlight this post!  
Unread 31-01-2008, 19:05
cprogrammer's Avatar
cprogrammer cprogrammer is offline
Registered User
FRC #1595 (Gremlins)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Washington
Posts: 42
cprogrammer will become famous soon enoughcprogrammer will become famous soon enough
Re: Ganged Interrupt Edge Detection

And what registry value outputs that information?
Thanks Stephen
  #6   Spotlight this post!  
Unread 31-01-2008, 19:31
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Ganged Interrupt Edge Detection

if you look in the default code in the interrupt handler

Code:
  else if (INTCONbits.RBIF && INTCONbits.RBIE)  /* DIG I/O 3-6 (RB4, RB5, RB6, or RB7) changed. */
  {
    int_byte = PORTB;          /* You must read or write to PORTB */
    INTCONbits.RBIF = 0;     /*     and clear the interrupt flag         */
  }
PORTB is the register. You have to read/write to it before you can clear the flag. Have a look at how Kevin does it in his encoder code, and do you know bitwise operators and the such?
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #7   Spotlight this post!  
Unread 31-01-2008, 20:00
cprogrammer's Avatar
cprogrammer cprogrammer is offline
Registered User
FRC #1595 (Gremlins)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Washington
Posts: 42
cprogrammer will become famous soon enoughcprogrammer will become famous soon enough
Re: Ganged Interrupt Edge Detection

Yea, but I got the impression that in his encoder code, he used the registry value to distinguish which interrupt had fired, not which edge was being detected.
  #8   Spotlight this post!  
Unread 31-01-2008, 20:37
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Ganged Interrupt Edge Detection

Thats where the 0 or 1 part comes into play. Take a look at the spec sheet and you will see what is in the PORTB register, and also look into bitwise operators (specifically XOR)
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #9   Spotlight this post!  
Unread 01-02-2008, 10:52
cprogrammer's Avatar
cprogrammer cprogrammer is offline
Registered User
FRC #1595 (Gremlins)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Washington
Posts: 42
cprogrammer will become famous soon enoughcprogrammer will become famous soon enough
Re: Ganged Interrupt Edge Detection

Quote:
Encoder_3_Int_Handler(Port_B & 0x10 ? 1 : 0); // call the encoder 3 interrupt handler (in encoder.c)
I see it now, the XOR gate operator for Port_B_Delta is to distinguish which interrupt fired. Then the line of code above inputs a 0 or 1 into the function to tell whether a rising or falling edge has interrupted. Thank you for all your help wt200999
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
rangefinding/object detection sciguy125 Electrical 14 13-01-2008 20:36
Collision Detection in Inventor? jlewellen Inventor 2 06-01-2005 21:29
Cutting edge... Eugene Technical Discussion 9 26-02-2002 02:59
Cutting edge... Eugene Technical Discussion 0 22-02-2002 18:27
Steel Edge AJ Howard Rules/Strategy 1 18-01-2002 18:52


All times are GMT -5. The time now is 23:46.

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