Hello community,
i bought a brandnew Arduino micro and i tried to run my own project on it.
In order to run a very time-critical application on it i don't wanna use the arduino libs. Instead, i wanna run my own avr C-program.
My first was to checkout the cpu frequency is correct, which means that the frequency is 16 Mhz.
However, when i run i simple led blink main, which is:
#define LIMIT 500000
uint32_t loopCount;
uint8_t state = 0;
int main() {
loopCount = 0;
DDRC |= (1 << DDC7);
while(1) {
if(loopCount == LIMIT) {
loopCount = 0;
state = (state) ? 0 : 1;
if(state)
PORTC |= (1 << PC7);
else
PORTC &= ~(1 << PC7);
}
loopCount++;
}
}
my led blinks with a period time of around 1 seconds. This is not what i expected.
It should be "LIMIT 16000000" to get a blink frequency of one second.