Generating a 120KHz pulse
Bob Ammerman email (remove spam text)
> >The closest you'll be able to get (with the 20MHz clock) is 8.2
> 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
> which is only 0.8% error.
> >12.000MHz or 18.000MHz would work fine.
> This is a better suggestion :)
Would you believe my floating point unit was set to truncate mode instead of
Or maybe that I did the calculation on a Pentium?
Or just that I wasn't thinking too clearly?
(contract development of high performance, high function, low-level
http://www.piclist.com hint: The PICList is archived three different
ways. See http://www.piclist.com/#archives for details.
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