Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pwm basics

Status
Not open for further replies.
Hi to everybody,
I've having the same problem here, that's to sat i need to generate a PWM for a servo motor, with period 20ms, and I cannot use the CCP since the minimun frequency is too high.

I undestand the method proposed by Mike, K8LH, where he creates a PWM wave from a series of PWM cycles. My question is:

I know that this solution is much better then a pure SW PWM where the PIC is polling waiting for chainging the output. My question is whether the Mike, K8LH's solution is better compared to a PWM wave generate using 2 timer events without the CCP.

I heard about jitter in case i use a normal pin (not PWM module) but i'd like to have your opinion too.

thanks a lot,
Luigi Malagò
 
by jitter, I assume you mean variation in the exact period of the pulses. the amount of jitter will be pretty small and the servo won't care at all.

I agree, don't use delay loops do this but no one proposed that solution. the timer interrupt solution is quite reasonable and you really only need one timer.
 
hi philba,
so when dealing with servo, the solution of generatin pwm wave with a timer without CCP is a good solution. Thanks for your opinion. So why using PWM? I mean, it's beacause of the relatively small frequency required by the servo or in many case i can used timers instead of CCP PWM?

I agree, don't use delay loops do this but no one proposed that solution.

Ok, i know it, I was referring to another article where different solution where proposed, icluding the polling one.. but it was clearly stated that it was inefficient.

Luigi
 
PWM simply refers to the variable width of the pulse. It doesn't imply a specific way of generating the pulse train.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top