Wednesday, October 7, 2009

Arduino as a clock source

Arduino as a 1MHz clock...

/* 1MHz Clock */

int ledPin = 7;

void setup() {
pinMode(ledPin, OUTPUT);
noInterrupts();
}

void loop() {
PORTD ^= 10000000;
asm("NOP");
asm("NOP");
asm("NOP");
}


Fastest Arduino (16MHz) output: 1.6MHz

No comments:

Post a Comment