Hi Terry,
Check the datasheet to see the effect of changing the prescaler with capture enabled.
That may be what's causing the bad capture value. You should be OK if you set it up for
every 16th edge before enabling capture. Switching prescaler with capture enabled can
cause odd results.
Edit: If you do need to do this, try disabling capture first, then changing prescaler.
CCP1CON=0 ' disable CCP module
Capture=0 ' clear capture flag
CCP1CON=%00000111 ' re-enable for every 16th edge
Never tried it myself, but it looks like it should work. Disabling the CCP module clears the
prescaler count.
Bookmarks