I made square wave with very simple sketch.
bool on = false;
// the setup routine runs once when you press reset:
void setup() {
pinMode(3, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
if (on == false){
digitalWrite(3, HIGH);
on = true;
}
else if (on == true){
digitalWrite(3, LOW);
on = false;
}
}
Fist I used Arduino Nano and the frequency of the resulting signal was 103kHz. Then I switched to Arduino Due and the frequency was only 111kHz.
How is this possible? As far as I know Due has over 5 times the clock speed of Nano. I do understand that Nano is AVR based and Due has ARM and the architecture is different, but isn't ARM supposed to be the faster of the two?
Is Due somehow throttled? Can I unleash its full power?