The ATtiny85 has two timers and six pins, one of which is reset. Decide which feature gets which timer.
What the message means
Libraries claim timers. millis(), PWM, tone and servo pulses all use them, so adding one can change or break another.
Fix it in this order
- Check which pins give hardware PWM in the pin diagram, usually the pins tied to Timer 0 and Timer 1.
- Use one timer-heavy feature at a time, or choose a library for your core.
- Do not use the reset pin as an I/O unless you accept the loss of easy programming.
- Check the clock speed setting, since timing depends on it.
- Use a board with more timers if you need many outputs.
- Test each feature alone before combining them.
Why it happens
The ATtiny85 has two 8-bit timers. Timer 0 drives millis-style timing and PWM on PB0 and PB1, and Timer 1 drives PWM on PB1 and PB4. Under most Arduino cores that gives hardware PWM on pins 0, 1 and 4. Anything that needs a timer, such as a software serial library, tone() or a servo library, takes one of the two away, so adding it can silently change the PWM frequency or stop it.
PB5 is the reset pin. Turning it into an I/O pin needs a fuse change, after which the chip can no longer be reprogrammed with an ordinary programmer, so avoid that unless you have no other choice.
If you see this, do this
| You see | Do this |
|---|---|
| PWM stops when the library starts | Timer conflict. |
| Timing wrong | Check the clock setting. |
Related
tone and Servo timers, Digispark not recognised.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
The ATtiny85 has two 8-bit timers. Timer 0 provides PWM on PB0 and PB1, and Timer 1 provides PWM on PB1 and PB4. Under most Arduino cores, millis() and delay() are built on Timer 0. If you change how Timer 0 counts, you change the timing of those functions too, so a delay of one second may take more or less than one second.
Other libraries compete for the same hardware. A servo library, a software serial port, an infrared library and tone() each need a timer or the timer interrupt. Since there are only two timers and the chip has six pins in total, one of which is reset, you need to plan which function gets which timer before you write the code.
How to confirm the cause
- Check the datasheet or core pin table to see which pins give PWM, and which timer feeds each one.
- Test each feature alone first: PWM alone, then tone alone. If each works alone but not together, the cause is a timer conflict.
- Time a one-second blink with a stopwatch. A visible error means a timer setting has changed millis() and delay().
- Measure the PWM frequency with a meter that has a frequency range or a logic analyzer. A frequency different from what you expected shows a changed prescaler.
- Check the clock setting in the board menu. The chip’s internal oscillator is often shipped dividing by 8, so 1 MHz, not 8 MHz.
Worked example
Setting up fast PWM on PB0 by hand with Timer 0, prescaler 8. At 8 MHz the PWM frequency is 8 000 000 / (8 x 256) = 3906 Hz. Note that this changes the timing used by delay() and millis() on most cores.
DDRB |= (1 << PB0); // PB0 as output
TCCR0A = (1 << COM0A1) | (1 << WGM01) | (1 << WGM00); // fast PWM
TCCR0B = (1 << CS01); // prescaler 8
OCR0A = 128; // about 50 percent dutyCommon mistakes
- Using three timer-hungry libraries in one sketch.
- Changing Timer 0 and still using delay() as if nothing changed.
- Using the reset pin as I/O without understanding the programming consequences.
- Assuming the chip runs at 8 MHz when the fuses give 1 MHz.
- Copying code written for an Uno, which has three timers and different pin names.
If this did not fix it
- Check the fuse setting for the clock source and the divide-by-8 option, since all timing depends on it.
- Check that the core you chose supports the features you use, since support differs between cores.
- Consider a chip with more timers and pins if the project keeps growing.