Go Down

Topic: Hardware Based PWM (Read 934 times) previous topic - next topic

skydve76

Hello,

Been using the Servo library and having some issues.  I noticed the servo library uses sodtware based PWM, setting interrupts etc.  This means my "Real time"  is not so real time anymore, due to all the interrupts.

The arduino has PWM pins, are these run at the hardware level and do not require any software intervention short of telling it the duty cycle?  I want to use them to drive servos and not bother my software with interrupts.  Anyone tried it?

The issue I am having is  I am suing serial, I2C as well as Pulse In and I think it is too much with 5 servos attached.

I am considering using another arduino just as a servo driver but it would still have to use I2C or serial anyways to get the values to set, so I am confused as the I2C routine will disable interrupts and I will still get some servo jitter.

Thanks.

AWOL

The problem with using hardware PWM for driving servos is typically limited resolution.
With a 5 - 10% duty cycle, you're limited in the range of values, unless you up the bit-count available from the usual eight bits.

MarkT

And you are limited to pins 9 and 10 only, since they are the only ones controlled
by 16 bit timer on the Uno.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

PaulS

Quote
I am suing serial, I2C as well as Pulse In
It's the damned lawyers causing problems.

Go Up