Forums

PWM Question

Started by jens_alsig November 11, 2006
Hi,

I have to control a RC servo and a small DC motor. The RC servo
requires a pulse every 20 mS. The pulse has to be between 1.5 mS and
2.5 mS, if I remember correct. The DC motor has to have a switch
frequency between 20 kHz and 25 kHz. The duty cycle have to be between
0 % and 100 %. (99 % is also ok)

Now my problem is how to configure the PWM module, especially the PWM
Match 0 register.

My target is a LPC2214.

Thanks,

Jens Alsig

An Engineer's Guide to the LPC2100 Series

Jens,

you require 2 PWMs with different base frequencies.
One PWM needs to be on 50 Hz (20 ms) while the other one should be on
20~25 kHz 40~50 us.

The PWM module, is actually 1 (one) timer with 6 match outputs so it
is not possible to create different frequencies like you need (a
double frequency could be managed by using 2 PWM outputs with 2 double
edge mode PWM outputs but that's as complex as you can get).

The other two timers (Timer0 & 1) also have match outputs that can be
used to create PWM outputs. I have not used this before myself, but
one of my previous posts
(http://tech.groups.yahoo.com/group/lpc2000/message/20384) contains a
link to an application that uses two timers as PWM outputs.

Good luck,

Rob