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.

PIC1F1508 with four PWM outputs operating at different frequency?

Status
Not open for further replies.
Thanks, oh no, we need some to be slower than others, thats why i was hoping that one of the pwm streams can have like a software flip flop put with it to make it say half the frequency
 

If the frequencies are multiple integers as you said (2x, 4x, 8x) and if the output lowpass filter circuit is properly sized, at first sight there is no impediment to do that as long as the signal to be generated has been oversampled during its capture or computation.
 

Provided your PWM frequency isn't too high you can generate your own PWM waveform in software like this:

1. use one of the hardware timers to generate the lowest base PWM frequency.
2. Use another hardware timer at higher speed to generate the delays between PWM 'steps' (resolution).
3. Set the output port bits according to the output of stage 1
4. Reset the bits according to (required delay * 'steps') from stage 2.

By adjusting the required delay value in stage 4 you change the pulse width. Replicating the calculation in stage 4 for different pins gives you the extra outputs you need.

I do it in a device that generates 11 individual PWM outputs from a now rather dated 16F877A using that method but I only use a PWM frequency of about 100Hz which may be slower than you need. In principle the method works as fast as your software will allow and it should be possible to reach several KHz without any difficulty.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top