View Single Post
  #3   Spotlight this post!  
Unread 02-02-2008, 18:09
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: Ultrasonic sensors on digital ports 3-6 problems

I have that interrupt routine function called inside the one that is written in the default code under user_routines_fast.c. Thats where I check the INCONbits.RBIF flag as well as the RBIE. Sorry I forgot to mention that. I do turn the actual interrupt off a lot so I do not get any bad data (from when I send the pulse) and each time I access it in Get_Distance() I turn it off, copy it, and turn it back on. I turn it off when I turn off the timer on the falling edge as well. I did see one where I have "//disable it" then I have it set to 1, but that shouldn't have effected it. Although I don't need to re-enable it in Get_Distance now that I think about it, because I re-enable it every time I call Ping(). But that shouldn't effect it either.
I was looking at Kevin's encoder code as a guide on how to get the interrupts 3-6 to work, and I have it almost how he has it.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -