> From: Dave VanHorn > > Is there any easy way to stop timer 1 in PWM mode, with the output pin > high? > > I'm using OC1B to generate an output with 100% - 0% duty cycle. > > I realize that I could turn off PWM mode entirely, returning the pin to > a straight I/O. > > I could make the turn-off conditional on getting a 0 on the pin > register, but I'm a little creeped out by that, as it might not always > dependably read a 1 or 0 Not sure I understand completely (I have not done PWM on an AVR yet) but: 1) At 'idle' times can you just leave the PWM at 100% (i.e.: pin is solid 1)? 2) If, when disabled, the PWM pin reliably goes to 0 you could just run the pin thru an inverter and use a duty cycle of 0 - 100% rather than 100% - 0% ... but, since I haven't used PWM yet, there's probably something I don't realize that is getting in the way. Cheers, Chuck Hackett "Good judgment comes from experience, experience comes from bad judgment" 7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck
Message
RE: [AVR-Chat] Timer 1 PWM Esoterica
2006-03-14 by Chuck Hackett
Attachments
- No local attachments were found for this message.