Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Generating Variable frequency in pic using PWM ?

Status
Not open for further replies.

bhadmanathan

Junior Member level 1
Joined
May 7, 2016
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
187
Hello all,

I need to generate variable frequency of range
125Hz to 500Hz.

Is it possible to generate variable frequency using PWM method ? (but not timer method).

I need constant duty cycle of 50%.

I want to control frequency using variable pot..


Thanks in advance
 

1. PWM is timer based perephireal
2. Constant duty cycle means no PWM, just clock pulses.
3. Smooth frequency steps is impossible without using DDS. But for such low frequency 10 Hz step is achivable.
 

Hi,

this question is asked and discussed many times here in this forum.
(did you notice the box "similar threads" at the bottom of this page?)

Only one "search" here in this forum or an internet search brings a huge ammount of results.

Even the datasheet tell you all you need to know.

****
Maybe your question is too general. Indeed there is no question. So we don´t know where you see the problem.

Please do a little research on your own, then come back with specific questions.

Klaus
 

You need to mention your PIC type. With common PIC18 types it's not possible to achieve the intended frequency range with PWM module due to insufficient PR2 register length.
 

Generate 1250 to 5000 Hz PWM 50% duty signals from PIC and use 74LS90 (divide by 10 counter) to get 125 to 500 Hz pulses.

See image. it shows a simulation of a project which I made.
 

Attachments

  • Variable Low Frequency PWM.png
    Variable Low Frequency PWM.png
    44.7 KB · Views: 257
Last edited:

Hello!

I need to generate variable frequency of range
125Hz to 500Hz.

I was about to reply something totally different, because your question is not well defined.
If you tell me about generating a frequency (put aside the fact that you cannote generate
a frequency but only a signal), it's evident it's a sine wave. Apparently other people think
differently.

If you want to generate a square wave with a frequency variable from 125 to 500 Hz, then
as replied above, you use a timer configured as PWM generator.

I want to control frequency using variable pot..

I have never met a fixed pot. The method would be like this:
- Measure your pot output and you will get a value depending on your ADC. For
example if it's a 12 bit ADC, you will get a value from the interval [0, 4096[
- As I suppose you want 125 when the pot is at 0 and 500 when it's at 4095, then
you can calculate the PWM period that gives you the proper range.

And that's about it.

Generate 1250 to 5000 Hz PWM 50% duty signals from PIC and use 74LS90 (divide by 10 counter) to get 125 to 500 Hz pulses.

I'm not sure whether you're serious or it's joke, but what's the point? You can (probably) generate this directly with a PIC
as you can do it with any µP. If you start playing with 74 LS chips, then why not using a 555 (and no 74LS)? You can
certainly do the exact same functionality with a 555 + pot, one resistor, one capacitor.

Dora
 

These days you can also do it with a DDS chip and get relatively low distortion sine waves (or square waves) with incredibly fine frequency increments.

Just a three wire SPI link back to your pic and you are in business.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top