|
Re: Gear tooth sensor / GTS on DIO 3,4,5,6?
The "short" pulse from the GTS is about 30 microseconds. If it takes longer than that for the interrupt service routine to get around to clearing the proper interrupt flag, you'll already have missed the falling edge and won't get another interrupt from it. That means that you'd only count one transition per pulse, as opposed to two for the other sensor, but I don't see why you'd get no counts.
Just as a random suggestion, try moving the code for pins 3-6 to as early in the ISR as possible, before any serial interrupt, pins 1-2, or timer interrupt checks. If it is the pulse length that's tripping you up, that might help.
One more thing occurs to me, and please forgive my nagging about it, but can you double-check to make sure you're not still testing the state of the input pin and deciding whether to increment or decrement the counter? If that code is still there, then you're actually getting counts for the short pulse (because you're always reading it as low by the time you test it), but you're counting one way and then immediately the other way for the long pulses so it doesn't look like you're counting at all.
|