On Sun, Feb 24, 2008 at 5:52 PM, J C <stereotyperjack@yahoo.com> wrote: > I am trying to control 2 servos with an ATMEGA16 running off of an 8MHz crystal. I have tried to figure it out with various code examples on the internet but don't seem to be getting it. Here is my code, any ideas? What I do, is to set up an array of bytes in memory, each holding a 0-255 value for pulse width. I add this to a minimum pulse width, and create timer values. I start all the servo pulses at once, then turn them off at the appropriate time using a single timer interrupt. So the output looks like AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC and so on. Then the framing pulse (15mS or so) is just a do-nothing time.
Message
Re: [AVR-Chat] Mega16 PWM
2008-02-25 by David VanHorn
Attachments
- No local attachments were found for this message.