Hi everyone, I just wanna know if there's a define to change the COUNT instruction for counting high to low instead of low to high transitions. I know I can simply place a little transistor to invert the signal but if a define can do the trick...
Printable View
Hi everyone, I just wanna know if there's a define to change the COUNT instruction for counting high to low instead of low to high transitions. I know I can simply place a little transistor to invert the signal but if a define can do the trick...
i don't think so but you can do it in software easily using an internal Timer/Counter. There you'll be able to specify the transition you need
Sometimes, depending the PIC, it's assign to PORTA.4/T0CKI pin.
easy to implement and, by far, much code efficient.
do a search with T0CKI and you should find something 'round here.
For every high there has to be a low. If you know the state of your input pin at the beginning and end of the count process, cannot you get high-low counts from the low-high count?
CountStart = PORTB.3
Count 3, 1000, W1
CountEnd = PORTB.3
Paul Borgmeier
Salt Lake City, Utah
USA