HPWM command and oscillator frequency


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263

    Question HPWM command and oscillator frequency

    My PBP manual (p. 74 or 76, depending on version) gives a nice table showing the minimum frequency that can be generated with HPWM, depending on oscillator frequency.

    But the lowest oscillator frequency (OSC) shown in that table is 4 MHz.

    What happens to the minimum HPWM frequency if a lower oscillator frequency is programmed?

    For example, what happens if I use (no matter why) 1 MHz? Is the minimum frequency still 245 Hz? Or is it scaled by 1/4 to 61.25 Hz?

    (Has anyone actually played with this? Or should I ask the folks at ME Labs? Maybe I should just do a jiffy program and put the PWM pin on the oscilloscope . . . )
    Last edited by RussMartin; - 8th March 2009 at 09:40.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink

    Hi, Russ

    [quote]
    What happens to the minimum HPWM frequency if a lower oscillator frequency is programmed?
    [quote]

    PBP calculations are based upon the Define OSC you've entered. ( default is 4 )
    HPWM module drive is based upon the Main OSC Period.

    so, the real HPWM frequency at output will raise ... in the inverse ratio ...



    NOW, if your XTAL has a lower frequency than declared ...

    HPWM frequency will be lower ... in the same ratio.


    I saw you've got the patent for the " Wine Oscillator " ... Great !!! Congratulations ( ROFL )

    Regards
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Because HPWM is taken from the internal timers and the internal timers are clocked from the xtal oscillator. The min. and max freq is depended of that.
    If you take a very low xtal, you min. freq is than very low and you max. freq. is than also not so high.
    Make a test and measure it thaan with an oscilloscope is alway good idea.

  4. #4
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    I put a scope on CLKOUT and looked at it and the PWM output pin.

    Everything seems proportionate.

    At the lowest oscillator setting (OSCON set for 125 kHz, so CLKOUT is 31.25 kHz),

    HPWM 1,127,8000

    gives a nice 250 Hz square wave.

    Since the ratio of 4000/125 = 32, 8000/32 should (and does) equal 250.

    I haven't determined maxima and minima yet, but I'll play with that next.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Members who have read this thread : 1

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