Conversation
Grazfather
reviewed
Oct 3, 2026
A single busy_sleep(20_000) compiles to a 7-cycle loop in ReleaseSmall, so each toggle took ~8.75 ms at 16 MHz and the LED looked solidly on. Repeating it 50 times gives ~437 ms per toggle (~1.1 Hz blink). Tested on an Emakefun RF-Nano V3.0 (ATmega328P @ 16 MHz): ~34 blinks in 30 s, matching the computed value.
matpala
force-pushed
the
atmega/fix-blinky-delay
branch
from
October 4, 2026 16:06
495ea6e to
aabf5bc
Compare
Grazfather
approved these changes
Oct 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On real hardware (ATmega328P @ 16 MHz, ReleaseSmall) the
blinkyexample toggled the LED every ~9 ms, so it looked solidly on.A single
busy_sleep(20_000)compiles to a 7-cycle loop (cpi/cpc/breq/adiw/rjmp), i.e. ~140k cycles ≈ 8.75 ms per toggle. This repeats it 50 times, giving ~437 ms per toggle (~1.1 Hz blink).Tested on an Emakefun RF-Nano V3.0 (Arduino Nano compatible, ATmega328P @ 16 MHz) with the
arduino-nano_blinkytarget: ~34 blinks in 30 s, matching the computed value. Thearduino-uno_blinkytarget uses the same chip and clock, so the same timing applies.