Sinewaves using interrupts.


Results 1 to 26 of 26

Threaded View

  1. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Thanks Hank! Glad to hear I am not the only nerd in the room.

    By jove, I think you've got it. Since the frequency is made from the value of the 16 bit timer, your precision is pretty good. Of course pre-scalers and post scalers could be used, depending on which timer, to broaden your frequency even more. So I would say you have lots of flexibility on the frequency.

    I am a filter newbie, so I only know that they are tuned to frequency. I noticed that Bruce had a book on filters ... and almost asked for that one as well....

    The 36 steps I used make it possible to offset the sines by 10 degree steps. Some people use 72 steps in their tables, and then that would be 5 degree offset. Not quite sure what you plan.

    I'm not sure if I follow exactly. You sometimes want to double the freqency, and sometimes off set the frequency, but keep the frequency? In any case, I think there is plenty of horsepower in the PIC to time your incoming frequency and also do sine out using hpwm. That is, as long as you find a good filter/sustainer to get a single frequency in for it to measure.

    http://www.picbasic.co.uk/forum/cont...-DT-interrupts
    as a quick break after sorting my ongoing phase measuring conundrum tonight (with a lot of help!) ...i decided to have a quick pop at this before hitting the sack...



    Quite happy with the result - but how did you work out the value for 60Hz - you can likely see from the scope trace that I messed about with some prescalers & variable & ultimately managed to get a higher frequency (about 400Hz...that's not my code alongside, but your article!), but it was all a bit 'hit & hope'....but what's the scientific way of getting the required frequency?

    Also any idea of the maximum frequency obtainable?
    Last edited by HankMcSpank; - 30th September 2010 at 01:30.

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