Terry, I don't know specifically of capture code examples, the microchip data books lay out general routines. You probably know;
-set ccp for capture on 16 rise edge
-tmr1 prescale to 1
-make int routine in asm and add int pointer name for basic
-set pie and pir's for interrupt enables
---on int -- check for tmr1 overflow(not usable count)
---stop ccp and tmr1
---move count high and low to basic count word
---reset flags capture and tmr1 overflow
---tmr1h and tmr1L = 0
---start ccp and tmr1
basic prog can start and stop interrupts as desired.
took me some good head scratching for int's but is very reliable when working.
Once working, pic will just keep spitting out counts automatically.
don
Bookmarks