View Full Version : Is it asking too much?
John Brewer
- 7th April 2006, 23:49
I am relatively new to pic programming and just done basic thing like timers and relay control. What I would like to do is use a pic to replace a 12 output mechanical frequency generator which ranges from 4186 Hz to 7902.1 Hz in 12 discrete steps. This would require two output ports as the outputs have to be constantly running. Does this sound a feasable idea or is it too much to ask from a pic. Any advice on whether to persue this project would be very welcom. Many thanks. John.
Melanie
- 8th April 2006, 09:39
How accurate does 7902.1Hz need to be?...
That's a 'approximate' cycle time of 126.54863896938788423330507080396uS... give or take a couple of digits...
Let's say your accuracy is +/- 1uS (you're running a 20MHz PIC and allowing for a handfull of instructions) that's worst case range of... 125usS to 127uS making 7874.01Hz to 8000Hz error window. with a 40MHz PIC and some really tight code you might reduce that to say +/- 100nS... that still gives an error of 126.4uS to 126.6uS namely 7898.89Hz to 7911.39Hz. What I'm trying to say is you'll be lucky to get within +/- 5Hz at that frequency.
Hmmmm... some things PICs on their own just aren't made to do.
Like another thread that had people wasting their lives getting a PIC to simulate a true Sine Wave... one of the joys of reading the forum is my coffee and morning laugh...
John Brewer
- 8th April 2006, 19:07
Sorry :-) the .1 was as printed in the frequency table of the generator manual thank you for taking the time to reply.
best regards.
John.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.