> Seems simple but I can't determine what should be interrrupt-driven > and what should be polled. Using timers alone for the PWM is out (I > think) because I need to run six motors. Run the PWM frequency too > high and I consume all of the cycles checking to see if a motor needs > to be started or stopped. Bear with me, I might not explain this well... When I played with software PWM once, I did it as per attached code. Basically, I use a timer to generate a master clock, on which I increment all the registers holding the PWM counts. If any hit zero or the limit, their respecive bits are set or cleared. Someone I gave the code to fairly recently had it working, I think. > Also need a serial packet protocol to frame the packets. Delay before > packet? 8th bit set on packet header and limit it to 7-bit data? That's how MIDI works. I've got some code somewhere I used to decode some MIDI messages, I think. Richard --- "Iz dana u dan ona dolazi i odlazi u talasima" http://www.van-gogh.co.yu/
Message
Re: [AVR-Chat] 6 PWM, Serial Tx and Rx on ATmega8 or 16?
2004-05-24 by Richard Reeves
Attachments
- No local attachments were found for this message.