Skip to main content

New answers tagged

1 vote

Timer setup interferes with LED blinking logic

First thing: setting OCR2A to 0 is wrong: if you want the interrupt to fire every microsecond (16 CPU cycles, 2 timer cycles), you should set OCR2A to 1. Then, as stated in some comments, there is no ...
Edgar Bonet's user avatar
  • 43.5k
1 vote

Timer CTC Set and Clear modes -- How to un-Clear and un-Set?

The comment by the OP under the question is: I meant how do I set the OC1A pin when i'm using the clear-on-match CTC mode (and vice versa) I know toggle changes it every match, but I don't understand ...
Nick Gammon's user avatar
  • 38.4k
1 vote

Timer setup interferes with LED blinking logic

You are enabling the timer compare interrupt, but you do not have an interrupt handler defined for it. You don't need to set that bit if you just want to output PWM. I think you should either remove ...
Delta_G's user avatar
  • 3,380

Top 50 recent answers are included