EmbeddedRelated.com
Forums

resolution for PWM driven servo on HCS12

Started by Steve Auch-Schwelk September 30, 2004


Hi Mike,

Thanks for your input.
I must admit that I have avoided the capture/compare functionality of
the hcs12 up until now becauase I don't fully understand it, and have
yet to find a consise functional description. I did read through the
provided block user guide, but found the descriptions too detailed,
and I could't see the "big picture". What can the capture/compare
timers do that a "normal" timer cannot? What would be an example of
an application?

thanks

Steve

--- In , "Mike" <mike@b...> wrote:
> Hi,
> I use the Output compare feature to drive RC servo. Prescale the
timer by 4
> and you will get a 2048 steps resolution and 20 ms period. Works
great.
> Mike
> ----- Original Message -----
> From: "Steve Auch-Schwelk" <steve_auch@y...>
> To: <>
> Sent: Monday, October 04, 2004 10:56 PM
> Subject: [68HC12] Re: resolution for PWM driven servo on HCS12 > >
> >
> > Thanks for the effort Edward, but your reply didn't really help me
> > understand my problem. Perhaps I didn't express myself clearly,
so it
> > looks like I will have to lay my ignorance bare, and hope that you
> > (or someone) can tell me where the error in my logic is.
> >
> > Servo's have a PWM period of 20ms (this is the time at which the
> > pulse must be repeated). Irrespective of my clock selection
values,
> > the PWM Channel Period Registers (PWMPERx) is one byte(0-255).
> >
> > If I set my clock rate, so that the PWMPERx multiplied by the
(scaled)
> > clock rate = 20ms, I have the maximum possible resolution for my
> > duty, which is 20ms/255, or 78 microseconds.
> >
> > The entire range of the servo control pulse is 1.25 to 1.75ms, or
a
> > delta of 500 microseconds.
> >
> > Therefore I have 500/78 = 6 possible values that I can set my
servo
> > to.
> >
> > Where are my 13 bits of resolution?
> >
> > thanks
> >
> > Steve
> > --- In , "Edward Karpicz" <karpicz@a...>
wrote:
> > > > Can anyone let me know if they have some suggestions for the
> > HCS12
> > > > prescale, scale, clock, and period, and duty settings for
running
> > a
> > > > standard servo (666Hz+/-130Hz or 1.25-1.75ms).
> > > >
> > > > My oscilator is 16MHz, so the bus clock is at 8MHz. It seems
that
> > the
> > > > resolution at these frequencies is pretty poor (or have I done
> > the
> > > > math wrong?).
> > >
> > > Poor resolution? log2(8M/666) gives ~13.5 bits of
resolution.
> > Maximal
> > > PWMPER =8M/666~12012.
> > >
> > > Edward
> > >
> > >
> > > >
> > > > Can anyone suggest, from their experience, what the most
> > versatile
> > > > values are?
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >





Perhaps I could write a big picture of ECT (Enhanced Capture Timer
module), having used it extensively for servos.

Probably my biggest advantage to using the ECT is the number of servos
increased. I don't use PWM for the servo because it would only drive
one servo for every two PWM registers (practically). When I use an
Output Compare (OC), I actually drive between 8 and 16 servos on a
single output! The disadvantage is perhaps more code, and perhaps more
processor time. Still, a worth-while advantage to use this hardware to
accellerate and keep accurate. I don't even need an interrupt because
the OC changes the output without waiting for software to service it.

Following is an overall picture.

Both Output Compare (OC) and Input Capture (IC) are based on the
hardware time clock. That is, they look at the register TCNT to
determine what "time" it is. TCNT is a 16-bit free-running counter
with prescaler from the bus clock. That gives a steady count, not
affected by any sort of software loop. Reading this value would give
you a timestamp. You notice of course, this can't tell time of day
because it would roll over to zero quite often during one day. An
ideal use, however, is to time pulse widths withing a 20 mS cycle.

The basic function of an OC is to tell the output exactly when it
should change state. Example: Configure TC0 as an OC in toggle mode.
Write TC0=0xe477. The hardware continously compares that value with
TCNT. When TCNT arrives at 0xe477, it will immediately set the flag
C0F and toggle the output pin PT0. Now to toggle again 500 uS from
then, set TC0 = (0xe477 + 500). That assumes TCNT is scaled to 1 uS (1
MHz). When TC0 compares with TCNT again, the output toggles again. The
limitation the maximum time you could add because it's only a 16-bit
timer.

The basic function of IC is to capture when the state changed on the
timer input pin. Say you had TC1 configured as IC, detecting rising
edges. When bit C1F in TFLG1 is detected, read TC1 to find exactly
what TCNT was when the change took place. Clear C1F and do something
else while waiting. When C1F is detected again, read TC1 and subtract
the previous captured value. That would tell the width of the pulse
from an external source.

To drive one servo with an Output Compare (OC), you could do something
like below.

variable Servo1 = desired servo pulse width (clock counts)

ServoLoop:
If C0F is not set, goto ServoLoop
If PT0 is low, goto ServoLow
configure output to go low
TC0 = TC0 + Servo1
goto ServoLoop
ServoLow:
configure output to go high
TC0 = TC0 + (20000 - Servo1)
goto ServoLoop

Jeff Smith
Robotronics, Inc.

--- In , "Steve Auch-Schwelk" <steve_auch@y...>
wrote:
>
>
> Hi Mike,
>
> Thanks for your input.
> I must admit that I have avoided the capture/compare functionality
of
> the hcs12 up until now becauase I don't fully understand it, and
have
> yet to find a consise functional description. I did read through
the
> provided block user guide, but found the descriptions too detailed,
> and I could't see the "big picture". What can the capture/compare
> timers do that a "normal" timer cannot? What would be an example of
> an application?
>
> thanks
>
> Steve
>




Hi,
Jefferson Smith explained the usage of OC for driving RC Servos perfectly.
To add to that, you can drive up to 10 servos from two OC output by chaining
the pulse and using a shift register chip like LM4017. One OC is set for
the 20ms period and the other is the pulse chain.
Good luck
Mike
----- Original Message -----
From: "Jefferson Smith" <>
To: <>
Sent: Saturday, October 09, 2004 1:12 AM
Subject: [68HC12] Re: resolution for PWM driven servo on HCS12 >
>
> Perhaps I could write a big picture of ECT (Enhanced Capture Timer
> module), having used it extensively for servos.
>
> Probably my biggest advantage to using the ECT is the number of servos
> increased. I don't use PWM for the servo because it would only drive
> one servo for every two PWM registers (practically). When I use an
> Output Compare (OC), I actually drive between 8 and 16 servos on a
> single output! The disadvantage is perhaps more code, and perhaps more
> processor time. Still, a worth-while advantage to use this hardware to
> accellerate and keep accurate. I don't even need an interrupt because
> the OC changes the output without waiting for software to service it.
>
> Following is an overall picture.
>
> Both Output Compare (OC) and Input Capture (IC) are based on the
> hardware time clock. That is, they look at the register TCNT to
> determine what "time" it is. TCNT is a 16-bit free-running counter
> with prescaler from the bus clock. That gives a steady count, not
> affected by any sort of software loop. Reading this value would give
> you a timestamp. You notice of course, this can't tell time of day
> because it would roll over to zero quite often during one day. An
> ideal use, however, is to time pulse widths withing a 20 mS cycle.
>
> The basic function of an OC is to tell the output exactly when it
> should change state. Example: Configure TC0 as an OC in toggle mode.
> Write TC0=0xe477. The hardware continously compares that value with
> TCNT. When TCNT arrives at 0xe477, it will immediately set the flag
> C0F and toggle the output pin PT0. Now to toggle again 500 uS from
> then, set TC0 = (0xe477 + 500). That assumes TCNT is scaled to 1 uS (1
> MHz). When TC0 compares with TCNT again, the output toggles again. The
> limitation the maximum time you could add because it's only a 16-bit
> timer.
>
> The basic function of IC is to capture when the state changed on the
> timer input pin. Say you had TC1 configured as IC, detecting rising
> edges. When bit C1F in TFLG1 is detected, read TC1 to find exactly
> what TCNT was when the change took place. Clear C1F and do something
> else while waiting. When C1F is detected again, read TC1 and subtract
> the previous captured value. That would tell the width of the pulse
> from an external source.
>
> To drive one servo with an Output Compare (OC), you could do something
> like below.
>
> variable Servo1 = desired servo pulse width (clock counts)
>
> ServoLoop:
> If C0F is not set, goto ServoLoop
> If PT0 is low, goto ServoLow
> configure output to go low
> TC0 = TC0 + Servo1
> goto ServoLoop
> ServoLow:
> configure output to go high
> TC0 = TC0 + (20000 - Servo1)
> goto ServoLoop
>
> Jeff Smith
> Robotronics, Inc.
>
> --- In , "Steve Auch-Schwelk" <steve_auch@y...>
> wrote:
> >
> >
> > Hi Mike,
> >
> > Thanks for your input.
> > I must admit that I have avoided the capture/compare functionality
> of
> > the hcs12 up until now becauase I don't fully understand it, and
> have
> > yet to find a consise functional description. I did read through
> the
> > provided block user guide, but found the descriptions too detailed,
> > and I could't see the "big picture". What can the capture/compare
> > timers do that a "normal" timer cannot? What would be an example of
> > an application?
> >
> > thanks
> >
> > Steve
> >
>
> Yahoo! Groups Links >



Thanks for the description Jeff, I now understand the concept of the
ECT.
One question about the specifics. Do you actively have to write in
the new pulse length when TCNT=TCO. In this case it seems that you
either have to actively poll (as in your example code), or I presume
that an interrupt could also be triggered, which could then be
serviced to do this.

In your text you say:
"I don't even need an interrupt because the OC changes the output
without waiting for software to service it."

But do you still have to react to the change to set the new TCO? Or
is there a way to have TCO "toggle" between the two values that I
have overseen? Steve

--- In , "Jefferson Smith" <imajeff84663@y...>
wrote:
>
> Perhaps I could write a big picture of ECT (Enhanced Capture Timer
> module), having used it extensively for servos.
>
> Probably my biggest advantage to using the ECT is the number of
servos
> increased. I don't use PWM for the servo because it would only drive
> one servo for every two PWM registers (practically). When I use an
> Output Compare (OC), I actually drive between 8 and 16 servos on a
> single output! The disadvantage is perhaps more code, and perhaps
more
> processor time. Still, a worth-while advantage to use this hardware
to
> accellerate and keep accurate. I don't even need an interrupt
because
> the OC changes the output without waiting for software to service
it.
>
> Following is an overall picture.
>
> Both Output Compare (OC) and Input Capture (IC) are based on the
> hardware time clock. That is, they look at the register TCNT to
> determine what "time" it is. TCNT is a 16-bit free-running counter
> with prescaler from the bus clock. That gives a steady count, not
> affected by any sort of software loop. Reading this value would give
> you a timestamp. You notice of course, this can't tell time of day
> because it would roll over to zero quite often during one day. An
> ideal use, however, is to time pulse widths withing a 20 mS cycle.
>
> The basic function of an OC is to tell the output exactly when it
> should change state. Example: Configure TC0 as an OC in toggle mode.
> Write TC0=0xe477. The hardware continously compares that value with
> TCNT. When TCNT arrives at 0xe477, it will immediately set the flag
> C0F and toggle the output pin PT0. Now to toggle again 500 uS from
> then, set TC0 = (0xe477 + 500). That assumes TCNT is scaled to 1 uS
(1
> MHz). When TC0 compares with TCNT again, the output toggles again.
The
> limitation the maximum time you could add because it's only a 16-bit
> timer.
>
> The basic function of IC is to capture when the state changed on the
> timer input pin. Say you had TC1 configured as IC, detecting rising
> edges. When bit C1F in TFLG1 is detected, read TC1 to find exactly
> what TCNT was when the change took place. Clear C1F and do something
> else while waiting. When C1F is detected again, read TC1 and
subtract
> the previous captured value. That would tell the width of the pulse
> from an external source.
>
> To drive one servo with an Output Compare (OC), you could do
something
> like below.
>
> variable Servo1 = desired servo pulse width (clock counts)
>
> ServoLoop:
> If C0F is not set, goto ServoLoop
> If PT0 is low, goto ServoLow
> configure output to go low
> TC0 = TC0 + Servo1
> goto ServoLoop
> ServoLow:
> configure output to go high
> TC0 = TC0 + (20000 - Servo1)
> goto ServoLoop
>
> Jeff Smith
> Robotronics, Inc.
>
> --- In , "Steve Auch-Schwelk"
<steve_auch@y...>
> wrote:
> >
> >
> > Hi Mike,
> >
> > Thanks for your input.
> > I must admit that I have avoided the capture/compare functionality
> of
> > the hcs12 up until now becauase I don't fully understand it, and
> have
> > yet to find a consise functional description. I did read through
> the
> > provided block user guide, but found the descriptions too
detailed,
> > and I could't see the "big picture". What can the capture/compare
> > timers do that a "normal" timer cannot? What would be an example
of
> > an application?
> >
> > thanks
> >
> > Steve
> >



Hi

Could you maybe give an example of where to use 10 servos at a time - a
model airplane maybe?

----- Original Message -----
From: "Mike" <>
To: <>
Sent: Friday, October 08, 2004 8:59 PM
Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12 >
> Hi,
> Jefferson Smith explained the usage of OC for driving RC Servos perfectly.
> To add to that, you can drive up to 10 servos from two OC output by
chaining
> the pulse and using a shift register chip like LM4017. One OC is set for
> the 20ms period and the other is the pulse chain.
> Good luck
> Mike
> ----- Original Message -----
> From: "Jefferson Smith" <>
> To: <>
> Sent: Saturday, October 09, 2004 1:12 AM
> Subject: [68HC12] Re: resolution for PWM driven servo on HCS12 > >
> >
> > Perhaps I could write a big picture of ECT (Enhanced Capture Timer
> > module), having used it extensively for servos.
> >
> > Probably my biggest advantage to using the ECT is the number of servos
> > increased. I don't use PWM for the servo because it would only drive
> > one servo for every two PWM registers (practically). When I use an
> > Output Compare (OC), I actually drive between 8 and 16 servos on a
> > single output! The disadvantage is perhaps more code, and perhaps more
> > processor time. Still, a worth-while advantage to use this hardware to
> > accellerate and keep accurate. I don't even need an interrupt because
> > the OC changes the output without waiting for software to service it.
> >
> > Following is an overall picture.
> >
> > Both Output Compare (OC) and Input Capture (IC) are based on the
> > hardware time clock. That is, they look at the register TCNT to
> > determine what "time" it is. TCNT is a 16-bit free-running counter
> > with prescaler from the bus clock. That gives a steady count, not
> > affected by any sort of software loop. Reading this value would give
> > you a timestamp. You notice of course, this can't tell time of day
> > because it would roll over to zero quite often during one day. An
> > ideal use, however, is to time pulse widths withing a 20 mS cycle.
> >
> > The basic function of an OC is to tell the output exactly when it
> > should change state. Example: Configure TC0 as an OC in toggle mode.
> > Write TC0=0xe477. The hardware continously compares that value with
> > TCNT. When TCNT arrives at 0xe477, it will immediately set the flag
> > C0F and toggle the output pin PT0. Now to toggle again 500 uS from
> > then, set TC0 = (0xe477 + 500). That assumes TCNT is scaled to 1 uS (1
> > MHz). When TC0 compares with TCNT again, the output toggles again. The
> > limitation the maximum time you could add because it's only a 16-bit
> > timer.
> >
> > The basic function of IC is to capture when the state changed on the
> > timer input pin. Say you had TC1 configured as IC, detecting rising
> > edges. When bit C1F in TFLG1 is detected, read TC1 to find exactly
> > what TCNT was when the change took place. Clear C1F and do something
> > else while waiting. When C1F is detected again, read TC1 and subtract
> > the previous captured value. That would tell the width of the pulse
> > from an external source.
> >
> > To drive one servo with an Output Compare (OC), you could do something
> > like below.
> >
> > variable Servo1 = desired servo pulse width (clock counts)
> >
> > ServoLoop:
> > If C0F is not set, goto ServoLoop
> > If PT0 is low, goto ServoLow
> > configure output to go low
> > TC0 = TC0 + Servo1
> > goto ServoLoop
> > ServoLow:
> > configure output to go high
> > TC0 = TC0 + (20000 - Servo1)
> > goto ServoLoop
> >
> > Jeff Smith
> > Robotronics, Inc.
> >
> > --- In , "Steve Auch-Schwelk" <steve_auch@y...>
> > wrote:
> > >
> > >
> > > Hi Mike,
> > >
> > > Thanks for your input.
> > > I must admit that I have avoided the capture/compare functionality
> > of
> > > the hcs12 up until now becauase I don't fully understand it, and
> > have
> > > yet to find a consise functional description. I did read through
> > the
> > > provided block user guide, but found the descriptions too detailed,
> > > and I could't see the "big picture". What can the capture/compare
> > > timers do that a "normal" timer cannot? What would be an example of
> > > an application?
> > >
> > > thanks
> > >
> > > Steve
> > >
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> Yahoo! Groups Links >
>




Hi,
RC servo are very efficient and relatively low cost device and can be used
anywhere in applications where you need position control. The PWM driving
method is used even in MIL-STD servos. In Robotic applications RC servos are
very popular.
I brought the usage of the LM 4017 just to show how to save output pins.
Mike
----- Original Message -----
From: "SS" <>
To: <>
Sent: Tuesday, October 12, 2004 3:18 AM
Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12 >
> Hi
>
> Could you maybe give an example of where to use 10 servos at a time - a
> model airplane maybe?
>
> ----- Original Message -----
> From: "Mike" <>
> To: <>
> Sent: Friday, October 08, 2004 8:59 PM
> Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12 > >
> > Hi,
> > Jefferson Smith explained the usage of OC for driving RC Servos
perfectly.
> > To add to that, you can drive up to 10 servos from two OC output by
> chaining
> > the pulse and using a shift register chip like LM4017. One OC is set
for
> > the 20ms period and the other is the pulse chain.
> > Good luck
> > Mike
> > ----- Original Message -----
> > From: "Jefferson Smith" <>
> > To: <>
> > Sent: Saturday, October 09, 2004 1:12 AM
> > Subject: [68HC12] Re: resolution for PWM driven servo on HCS12
> >
> >
> > >
> > >
> > > Perhaps I could write a big picture of ECT (Enhanced Capture Timer
> > > module), having used it extensively for servos.
> > >
> > > Probably my biggest advantage to using the ECT is the number of servos
> > > increased. I don't use PWM for the servo because it would only drive
> > > one servo for every two PWM registers (practically). When I use an
> > > Output Compare (OC), I actually drive between 8 and 16 servos on a
> > > single output! The disadvantage is perhaps more code, and perhaps more
> > > processor time. Still, a worth-while advantage to use this hardware to
> > > accellerate and keep accurate. I don't even need an interrupt because
> > > the OC changes the output without waiting for software to service it.
> > >
> > > Following is an overall picture.
> > >
> > > Both Output Compare (OC) and Input Capture (IC) are based on the
> > > hardware time clock. That is, they look at the register TCNT to
> > > determine what "time" it is. TCNT is a 16-bit free-running counter
> > > with prescaler from the bus clock. That gives a steady count, not
> > > affected by any sort of software loop. Reading this value would give
> > > you a timestamp. You notice of course, this can't tell time of day
> > > because it would roll over to zero quite often during one day. An
> > > ideal use, however, is to time pulse widths withing a 20 mS cycle.
> > >
> > > The basic function of an OC is to tell the output exactly when it
> > > should change state. Example: Configure TC0 as an OC in toggle mode.
> > > Write TC0=0xe477. The hardware continously compares that value with
> > > TCNT. When TCNT arrives at 0xe477, it will immediately set the flag
> > > C0F and toggle the output pin PT0. Now to toggle again 500 uS from
> > > then, set TC0 = (0xe477 + 500). That assumes TCNT is scaled to 1 uS (1
> > > MHz). When TC0 compares with TCNT again, the output toggles again. The
> > > limitation the maximum time you could add because it's only a 16-bit
> > > timer.
> > >
> > > The basic function of IC is to capture when the state changed on the
> > > timer input pin. Say you had TC1 configured as IC, detecting rising
> > > edges. When bit C1F in TFLG1 is detected, read TC1 to find exactly
> > > what TCNT was when the change took place. Clear C1F and do something
> > > else while waiting. When C1F is detected again, read TC1 and subtract
> > > the previous captured value. That would tell the width of the pulse
> > > from an external source.
> > >
> > > To drive one servo with an Output Compare (OC), you could do something
> > > like below.
> > >
> > > variable Servo1 = desired servo pulse width (clock counts)
> > >
> > > ServoLoop:
> > > If C0F is not set, goto ServoLoop
> > > If PT0 is low, goto ServoLow
> > > configure output to go low
> > > TC0 = TC0 + Servo1
> > > goto ServoLoop
> > > ServoLow:
> > > configure output to go high
> > > TC0 = TC0 + (20000 - Servo1)
> > > goto ServoLoop
> > >
> > > Jeff Smith
> > > Robotronics, Inc.
> > >
> > > --- In , "Steve Auch-Schwelk" <steve_auch@y...>
> > > wrote:
> > > >
> > > >
> > > > Hi Mike,
> > > >
> > > > Thanks for your input.
> > > > I must admit that I have avoided the capture/compare functionality
> > > of
> > > > the hcs12 up until now becauase I don't fully understand it, and
> > > have
> > > > yet to find a consise functional description. I did read through
> > > the
> > > > provided block user guide, but found the descriptions too detailed,
> > > > and I could't see the "big picture". What can the capture/compare
> > > > timers do that a "normal" timer cannot? What would be an example of
> > > > an application?
> > > >
> > > > thanks
> > > >
> > > > Steve
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links


How can you instruct the servo to run in two different direction (either
clockwise or counter clockwise)?.

>From: "Mike" <>
>Reply-To:
>To: <>
>Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12
>Date: Tue, 12 Oct 2004 05:45:55 +0200
>

_________________________________________________________________
Check out Election 2004 for up-to-date election news, plus voter tools and
more! http://special.msn.com/msn/election2004.armx


RC servo works this way: The input is a PWM signal with period of 20 ms and
pulse width between 0.9-2.2 ms. At 1.5 ms pulse width the servo is centered,
0.9 ms it will go to one direction and 2.2 to the other. very simple and
efficient.
Mike

----- Original Message -----
From: "John Tobias" <>
To: <>
Sent: Tuesday, October 12, 2004 8:05 AM
Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12 >
> How can you instruct the servo to run in two different direction (either
> clockwise or counter clockwise)?.
>
> >From: "Mike" <>
> >Reply-To:
> >To: <>
> >Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12
> >Date: Tue, 12 Oct 2004 05:45:55 +0200
> >
>
> _________________________________________________________________
> Check out Election 2004 for up-to-date election news, plus voter tools and
> more! http://special.msn.com/msn/election2004.armx > Yahoo! Groups Links


Mike,

I don't know how to convert the 1.5ms and 0.9-2.2ms in the actual value and
which registers of PWM should I put that value to run in one direction and
other way around.
Could you pls send me some instructions and how to get the relative value of
1.5, 0.9-2.2ms pulse width.

Thanks,

John

>From: "Mike" <>
>Reply-To:
>To: <>
>Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12
>Date: Tue, 12 Oct 2004 12:39:17 +0200
>

_________________________________________________________________
Check out Election 2004 for up-to-date election news, plus voter tools and
more! http://special.msn.com/msn/election2004.armx



John,
I don't use the PWM register to produce the servo signal. I use the Timer OC
feature because I think it is more simple.
The algorithm is very simple: I prescale the timer by 4 (on 8 mHz bus) so 1
ms is represented by 2000 counts.
on 1st OC set pin to high then set the next OC to the desired PWM: TC0+=
PWM (for pt0 pin...)
on 2nd OC set pin low then set next OC to TC0+@000-PWM (for the 20 ms
period)
then go back to the beginning.
Hope it helps
Mike

----- Original Message -----
From: "John Tobias" <>
To: <>
Sent: Tuesday, October 12, 2004 10:16 PM
Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12 >
> Mike,
>
> I don't know how to convert the 1.5ms and 0.9-2.2ms in the actual value
and
> which registers of PWM should I put that value to run in one direction and
> other way around.
> Could you pls send me some instructions and how to get the relative value
of
> 1.5, 0.9-2.2ms pulse width.
>
> Thanks,
>
> John
>
> >From: "Mike" <>
> >Reply-To:
> >To: <>
> >Subject: Re: [68HC12] Re: resolution for PWM driven servo on HCS12
> >Date: Tue, 12 Oct 2004 12:39:17 +0200
> >
>
> _________________________________________________________________
> Check out Election 2004 for up-to-date election news, plus voter tools and
> more! http://special.msn.com/msn/election2004.armx > Yahoo! Groups Links >