0

Provided a very simple sketch like this:

void loop() {
  digitalWrite(1, !digitalRead(1));
}

... should I expect 5V Arduino to run twice as fast as 3.3V, or are there some internal adjustments in place?

Specifically, I'm wondering about Pro Mini and/or Nano boards. The "speed" here is simply the frequency measured on pin 1.

edit:


To clarify, I'm wondering if there might be some behind-the-scenes frequency divider that makes sure Arduino code always run at the same physical speed, even if the actual MCUs run on different clocks.


Possibly the simplest way of forming this same question: Can the sketch above be used to identify 3.3V Pro Mini boards from 5V versions, with the help of a frequency meter?

1
  • In theory a 3.3v ATmega could run at 12 MHz in which case it would be 3/4 as fast. In practice people sometimes run at 16 MHz, which is out of spec for that voltage but sometimes works. But yes, 8 MHz or half speed is the simple, safe choice. May 14 '16 at 1:12
1

If the board is running at half the speed (8MHz instead of 16MHz) then everything that isn't based on real time (i.e., millis(), delay() etc) will run at half the speed. It will all take twice as long to do everything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.