Hello, I have successfully used TC2 - timer/counter2 as a pwm generator with the following settings:
DDRB |= (1 << DDB3); // pin 11 on arduino (OC2A) TCCR2A |= (1 << COM2A1) | (1 << WGM20); // phase correct, clear on compare match TCCR2B |= (1 << CS22); // 64 prescaler
I use OCR2A to change period etc.
So I thought the TC0 - timer/counter0 could be used in the same manner, swapping the digits of course:
DDRD |= (1 << DDD6); // pin 6 on arduino (OC0A) TCCR0A |= (1 << COM0A1)| (1 << WGM00); TCCR0B |= (1 << CS02);
However, it doesn't seem to work. I use OCR0A in the same way to change the period.
What am I missing? Just because they have similar names/enumerations doesn't mean they will work the same but, please give me some clue (: