Thread: Master Code
View Single Post
  #8   Spotlight this post!  
Unread 05-02-2007, 13:42
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: Master Code

Quote:
Originally Posted by The Vrooman View Post
We have the gyro working with the default gyro code, so we know that it can't be an electrical problem.

We took the gyro.c, gyro.h, adc.c, and adc.h from the defualt code so we know that they aren't the problem either.

So here is our user_rountines_fast.c.

Please fix it.

If you can't find anything wrong with it do you have any ideas what other files would make the gyro not work.

Thanks,
Team 1137
You have a piece of redundant code that clears the encoder interrupt flags before the encoder code executes. See my comment in user_routines_fast.c. In user_routines_fast_rkw.c I've fixed the problem and re-arranged the ISRs to be more efficient. As I don't know if you're using both serial ports and the number of encoders, you should delete any code for features you're not using. Also, keep the ADC sample rate as low as you can and keep the encoder-generated interrupts as low as possible (a few hundred per second is fine).

-Kevin
Attached Files
File Type: c user_routines_fast.c (9.5 KB, 53 views)
File Type: c user_routines_fast_rkw.c (9.0 KB, 54 views)
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org