Low frequency Hardware PWM


+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,065

    Default Low frequency Hardware PWM

    Is it possible to have 50Hz PWM with any PIC?

    I think Alain mentioned that CCP module could do that but have no clue how.

    Ioannis

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,569


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    what chip what osc ?

    a 16f18426 can do it @8mhz
    a 18f27q43 can do it at any fosc
    k42 family is a likely candidate too
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,065


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    I will not stick to specific PIC.

    Any one that can do it is OK with me. K42 is most likely the one.

    Thanks Richard,

    Ioannis

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,070


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    Quote Originally Posted by Ioannis View Post
    Is it possible to have 50Hz PWM with any PIC?

    I think Alain mentioned that CCP module could do that but have no clue how.

    Ioannis
    Are you talking PWM or HPWM? Isn't using the CCP module automatically HPWM?

    I kept hitting my face into the chart in the PBP manual under HPWM that lists lowest possible frequency per oscillator speed. Even at 4MHz it's a minimum 245Hz (I'm not really interested in PWM).

    How are you folks getting around that? Assembler?
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,569


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    How are you folks getting around that? Assembler?
    its not quite that simple, contemporary chips like 18f27q43 have a pwm module that can use alternative clock sources like the mfosc @[500k] and its that allows 50hz operation, some others have much bigger timer2 type prescalers that can get there in a pinch too

    i doubt the hpwm command can select the alternative clock/prescaler so some manual intervention will be needed. its not rocket science and if you plug it into MCC it does all the heavy lifting
    Warning I'm not a teacher

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,065


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    Quote Originally Posted by Demon View Post
    Are you talking PWM or HPWM? Isn't using the CCP module automatically HPWM?
    My interest is in hardware PWM but PBP cannot manipulate the appropriate registers that is needed to get that low on frequency, as Richard noted.

    Have not done it yet but hope to manage it.

    Ioannis

  7. #7
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    You might consider using the Numerically Controlled Oscillator (NCO) to achieve this low frequency output.
    I have recently been looking at the 16F1503 to achieve a stable 1Hz output.
    This device has the ability to do both 50% duty cycle (my particular interest) as well as PWM output.

    Agreed, this is not something that is doable directly from PBP commands but is quite manageable with register manipulation.

    Cheers
    Barry

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,065


    Did you find this post helpful? Yes | No

    Default Re: Low frequency Hardware PWM

    Thanks Barry.

    Never thought of that NCO.

    Ioannis

Similar Threads

  1. Low frequency generator
    By lerameur in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 29th September 2013, 22:53
  2. HPWM at very low frequency
    By lerameur in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th May 2013, 09:41
  3. Low frequency PWM
    By Charlie in forum General
    Replies: 3
    Last Post: - 16th February 2011, 15:31
  4. Low-Frequency Counter
    By Zeke in forum General
    Replies: 7
    Last Post: - 19th January 2006, 19:06
  5. Low frequency output
    By barkerben in forum General
    Replies: 5
    Last Post: - 16th November 2004, 16:25

Members who have read this thread : 16

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