View Single Post
  #2   Spotlight this post!  
Unread 02-02-2008, 12:20
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Ultrasonic sensors on digital ports 3-6 problems

I think you are not using the interrupt register properly. INTCONbits.RBIE enables the interrupts if equal to 1. It looks like you have that backwards in some places. To see if the interrupt occurred (in your ISR) check INTCONbits.RBIF, this will be 1 if an interrupt occurred and should be cleared before exiting the ISR. I do not see where you access RBIF at all.

Kevin's encoder source is an excellent resource. Examine the functions where he enables the encoders and his ISR.

HTH