Low frequency generator


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default Low frequency generator

    Hi,

    I am trying to make a low frequency generator at 50% duty cycle.
    Low meaning from 10hz to 250hz.
    After 245Hz, I can use the command HPWM
    (and why dont they make the command HPWM go down to 1- Hz ?!! .. )

    I have tried Pulsout, PWM, High Low commands...
    Found Darrel link at : http://www.darreltaylor.com/DT_INTS-14/SPWM.html
    I'm not an expert programmer, just looking for a simple solution.

    thanks
    Ken

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    Mainly I need a frequency output from 10Hz to 1200Hz approximately.
    I decrease the internal oscillator down to 1Mhz and I'm getting down to 62Hz with HPWM, but the max frequency is then barely 400Hz !.
    I programmed PWM myself , but with same result as HPWM.
    Thought I found it with this program: http://melabs.com/samples/PBP-mixed/hardpwm.htm
    Unfortunately not, played around with PR2 and other parameters, still nt getting the result I want...

    K

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    Which chip are you currently using? Can you switch to another if a more suitable solution exists?

    /Henrik.

  4. #4
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    I am using 16F88, at this point I am able to view all options...

    ken

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    some people mentioned by other post to play around with capture mode CCP OSC, But the bandwidth is very small, Altering with parameters changes another.. ending up where I started !!
    K

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    Hi,
    If you run the PIC at 1MHz and set the TMR2 prescaler to 1:16 then the lowest possible frequency, ie with PR2=255, would (if my calcs are correct) be around 24Hz, 1/(256*4*2.5us*16). If you run that thru an external flip-flop you'll get a divide by 2 ratio so you're down to 12Hz AND you'll get your 50% dutycycle for free - without having to change the dutycycle registers when you change frequency. You should be able to reach 1200Hz with this setup, ie PR2=1 the PWM frequency would be 3125Hz which, after the external 1:2 divider would give you 1562.5Hz. However, the granularity or resolution at the top end will be far from great.

    What else, except generating this frequency, is the chip going to do?

    /Henrik.

  7. #7
    Join Date
    Sep 2013
    Location
    Dhaka, Bangladesh
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    How make 2 PWM output at 50Hz fixed frequency in PIC16F72 with feedback in picbasic pro?

  8. #8
    Join Date
    Sep 2012
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    Better to use software pwm with time sliced method using timer0.

  9. #9
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Low frequency generator

    Hi Ken,
    We can use a computer when a sledgehammer will do? Way back before dirt was invented people used 555 & 556 timer chips $0.15 to $0.25 US to do this. alternatively you could use the PIC to swing the duty cycle from an adjustable analog oscillator.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. HPWM at very low frequency
    By lerameur in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th May 2013, 08:41
  2. Frequency generator
    By lerameur in forum General
    Replies: 3
    Last Post: - 11th November 2010, 11:32
  3. Frequency Generator
    By ExYu in forum Off Topic
    Replies: 2
    Last Post: - 22nd January 2008, 18:25
  4. Low cost audio function generator(DDS)
    By sougata in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 8th February 2007, 13:23
  5. Low-Frequency Counter
    By Zeke in forum General
    Replies: 7
    Last Post: - 19th January 2006, 18:06

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