You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The delay, micros and millis functions don't work properly when using the internal clocks on ATmega and ATtiny:
On an ATmega 168/328p running at 8 MHz, the sketch below blinks the LED once a second as expected, but running at 1 MHz it blinks the LED faster (around 8 times a second);
On an ATtiny 85 running at 8 MHz, the sketch below blinks the LED slower (around once every 8 seconds), but running at 1 MHz blinks the LED about once a second as expected.
I'm using the following configurations, which used to work correctly at least for 1, 8, and 16 MHz (external and internal clocks) the last time I checked (which was a while ago):
On top of this, the delayMicroseconds doesn't seem to work for any clock speed. But that's the case for a regular Arduino running at 16 MHz, so I suspect either this is another issue entirely or I'm not doing something right.
This part was the key. I just checked the fuses and noticed they weren't as I expected. I'd completely forgot that from the Arduino IDE one has to "Burn Bootloader" to update the fuses after selecting a different clock speed from the menu.
The
delay
,micros
andmillis
functions don't work properly when using the internal clocks on ATmega and ATtiny:I'm using the following configurations, which used to work correctly at least for 1, 8, and 16 MHz (external and internal clocks) the last time I checked (which was a while ago):
On top of this, the
delayMicroseconds
doesn't seem to work for any clock speed. But that's the case for a regular Arduino running at 16 MHz, so I suspect either this is another issue entirely or I'm not doing something right.The text was updated successfully, but these errors were encountered: