Unstable sine PWM output


Results 1 to 30 of 30

Threaded View

  1. #17


    Did you find this post helpful? Yes | No

    Default Re: Unstable sine PWM output

    Maybe it isn't DIV32... I don't know, but when I remove it, the glitches disapppears. I've also already tried to change the dummy values.

    My min. frequency is 1Hz (freq=10), reload value=about 0
    and my max. frequency is 120Hz (freq=1200), reload value=about 64600

    And I don't directly use the 0-1023 potentiometer value, first I convert it to the "freq" variable :

    Code:
    potsense=(potsense<<6)**maxfreq
    "maxfreq" correspond to the maximum frequency defined by the user. Here, "maxfreq"=1200. So here "freq" variable varies between 0 and 1200. Note I'm using an additional number to have the 0.1Hz accuracy (for exemple, 50.2Hz frequency equals freq=502).

    I have to said, your timer reload routine with DIV32 was pretty accurate and provides very good results. In terms of accuracy, I really had a 0.1Hz precision, both in low and high frequencies.
    Last edited by pxidr84; - 14th May 2011 at 11:52.

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