Frequency Scaling - remapping
Peter Betts email (remove spam text)
> Example: set CAP1 to gather timer1 count each rising edge.
> Let timer1 free
Sorry for being dumb but this means at the internal clock rate, no
prescaler. i.e. timer1 increments every 4th clock cycle? Yes?
> Use timer2 set to overflow at a count of say 250 and an
> interrupt on
Doh! I must have missed that. I didn't know you could set where the overflow
would occur, I've been assuming it was always on 255->256 count! Hows that
>That means you'll be sampling your "captured"
> signal every 1/4 ms
> (250 useconds - assuming a 4 Mhz xtal). A signal of 2000 kHz
> would have a
> count of 500 (plus or minus roughly one by jitter).
So run a 16bit counter/storage to get so decent resolution.
I've included my PIC code in another reply to this posting so maybe you can
point out some NOVICE mistakes! Can anyone point me to some example code?
Excellent help from the list by the way, expecially the maths stuff in the
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the