piclist 2000\06\09\091714a >
Thread: Frequency Scaling - remapping
face BY : pandersnKILLspam@@spam@idir.net email (remove spam text)

Right. Say xtal running at 4 Mhz. Then your instruction or "clock" rate
will be 1 Mhz. Timer2 will count once each instruction cycle. Setting a
timer2 at 250 will give you then a 4 kHz rate. Turn off the pre-scalar and
post-scalar, just set 250 in timer2 reg. Enable interrupts for timer2 of
course. Then process your flags at the capture input during each timer2
interrupt - this gives you a constant sampling rate.

You are sampling an event (a flag), so you do NOT have to sample at > twice
the freq content of the input signal (sampling theorem), that is for audio,
not freq measuring!.

Hope that helps. Hey, download (adobe) the Embedded  Micro Book from
Microchip's web site. It does a reasonable job of explaining all of the
peripherals, including the timers.

Phil Anderson....have a good day! Go kick a Tae Kwon Do bag!

On Wednesday, June 07, 2000 1:39 AM, Peter Betts
[SMTP:RemoveMEpeter.bettsRemoveMEspamspamBeGoneNOKIA.COM] wrote:
{Quote hidden}

> would occur, I've been assuming it was always on 255->256 count! Hows
{Quote hidden}

> 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
> archives :-)
> Pete


See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Frequency Scaling - remapping

month overview.

new search...