Thread: GTS Counting
View Single Post
  #1   Spotlight this post!  
Unread 21-02-2006, 11:02
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Question GTS Counting

I have installed the GTS sensors on both sides of the robot. The documentation indicates that the pulse from the sensor is a 39 microsecond wide rising pulse for a clockwise rotation and an 83 microsecond wide pulse for a counter-clockwise rotation. How would one differentiate between the widths of the pulses in the interrupt handler?

I have a feeling that I need to set the interrupt to fire and high and low transitions, and use a timer to monitor the length of the pulse. However I have no idea how to set that up on the PIC. Is there any documentation or example code I should be aware of? Can a timer even measure in microseconds?

Thanks in advance,
Robinson
__________________
'... who are you, then?'
'I am part of that power which eternally
wills evil and eternally works good.'
Goethe, Faust

Last edited by gnirts : 21-02-2006 at 11:20.