Thread: GTS Counting
View Single Post
  #5   Spotlight this post!  
Unread 28-02-2006, 15:20
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: GTS Counting

I can "guess" at the wheel direction except when we are coasting down or we're at idle (PWM=127). I wanted to know if we were being pushed off our spot when idle so what I was planning on doing was polling the GTS interrupt bit looking for a high value and doing a count while it was high. I'd leave the GTS interrupt routine on so the count would be missing the GTS ISR compute time. If the 50us interrupt latency is correct in Easy C, then either I'll never see the GTS bit going one way or have a really small count for that direction but should see a much larger part of the pulse (the 2x part) when going the other way. This was put in the housekeeping loop of the code - we tightly poll for about 1ms then come out for the other housekeeping portions and then right back in again. The code is just looking for "hints" and once it has seen 10 pulses it stops looking until the next 25ms sample time.

I never got to try the code out before the 'bot shipped though so I don't know if that would work or not.

DCBrown