PDA

View Full Version : COUNT Function



Toley00
- 28th June 2006, 02:46
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...

mister_e
- 28th June 2006, 03:16
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.

paul borgmeier
- 28th June 2006, 06:26
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