I think it would be better to leave it on "Every Rising Edge". Start the timer on the first edge, count 15 more interrupts, then stop the timer.
Of course, for that you can use an external interrupt (without the CCP) to do the same thing.
<br>
I think it would be better to leave it on "Every Rising Edge". Start the timer on the first edge, count 15 more interrupts, then stop the timer.
Of course, for that you can use an external interrupt (without the CCP) to do the same thing.
<br>
DT
Thanks for your prompt reply.
I read somewhere that CCP module is less intrusive than "normal "interrupt loops.
If i could read 16 high edges i'll get just one interrupt and my job would be done. I'm already using Usart,I2c,PORTB, PORTB0,tmro, tmr2 interrupts and when polling for incoming data sometimes i'm loosing an interrupt.
Roberto
That's true, it can be "Less Intrusive", under certain conditions.
But like you said, you would need 17 low-high transitions to get the reading you're looking for. If that works for you then CCP is a good way to go. But if it has to be 16, then there's no way to start the timer at the right time.
I hope you're using ASM interrupts, cause all that stuff will never work with ON INTERRUPT.
<br>
DT
Bookmarks