piclist 2001\01\29\075626a >
Thread: Generating a 120KHz pulse
www.piclist.com/techref/microchip/devices.htm?key=pic
picon face BY : Bob Ammerman email (remove spam text)



> >The closest you'll be able to get (with the 20MHz clock) is 8.2
> >microseconds.
>
> I beg to differ :)

And, of course, you'd be right!

>
> >This is an error of (8.3333-8.2)/8.33333 = about 1.6%
> >The actual frequency would be 121.951 KHz.
>
> However, if you used 8.4us (1 more instruction), you could get 119.047
KHz,
> which is only 0.8% error.

Duh...

> >12.000MHz or 18.000MHz would work fine.
>
> This is a better suggestion :)
> --Andrew

Would you believe my floating point unit was set to truncate mode instead of
round-to-nearest?

Or maybe that I did the calculation on a Pentium?

Or just that I wasn't thinking too clearly?

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


<002301c089f1$aa1e25c0$1ae9c540@sciencekit.com> 7bit

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) Generating a 120KHz pulse

month overview.

new search...