Is it asking too much?


Closed Thread
Results 1 to 3 of 3
  1. #1
    John Brewer's Avatar
    John Brewer Guest

    Default Is it asking too much?

    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.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default Yes! (It is asking too much!)

    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...

  3. #3
    John Brewer's Avatar
    John Brewer Guest


    Did you find this post helpful? Yes | No

    Default

    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.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts