You wouldn't use PWM to do that, you'd simply use the timer to fire the ISR at the resolution you want. For instance, if you want a 1KHz PWM and you want an 8 bit resolution then you'd need to set your timer to interrupt every (1ms/256). Turn the LED on at the beginning of the cycle and off when you reach the count for the on-time you want. DLC Thomas Keller wrote: > OK, one guy wrote back and said it wasn't possible, but I don't think > that's > correct, because the PWM can also trigger interrupts. Again: > > I need to drive more than 20 mA to an LED being PWMed by an ATtiny25. > I want to use the PWM module on timer/counter0 to drive an interrupt > routine that sets and clears, as appropriate, a pair of GPIOs driving my > LED > to ~~30-35 mA. ( I really don't have the physical room in my > environment for > one more transistor, very very tight environment) > > Problem is, the data sheet material on this particular issue has me > confused, > not clear on what I should be doing. Any help? > > tom > > > > > Yahoo! Groups Links > > > -- ------------------------------------------------- Dennis Clark TTT Enterprises www.techtoystoday.com -------------------------------------------------
Message
Re: [AVR-Chat] PWM problem
2007-10-10 by dlc
Attachments
- No local attachments were found for this message.