Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Decode Servo PWM Signals

2005-04-26 by Dave Hylands

Hi Joel,

> Hi
> I would like to decode PWM signals, for servos, such as those on model
> pr rc airplanes. Does anybody have any experience, hints, tips, code,
> google keywords or anything of the like?

I have some code that works for an ATMega8. I modified it from some
code from the OSMC project.

You can find it here:
http://www.DaveHylands.com/Software/Pulse-Stretcher/Pulse-Stretcher.zip

It uses a timer setup to run at 8 uSec/tick, and generates an
interrupt on each edge of the pulse. It can count upto 256 8 uSec
ticks or 2048 msec. If you know that the pulses have a minimum width
of 0.5 msec, then you can measure 0.5msec to 2.5msec with 8usec
resolution (you would treat low values as wrapped).

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.