I'm finding that when I'm using Timer 1 that the micros()
function stops functioning correctly. I thought that:
- Arduino internal functions (except PWM on pins 9. 10 which i'm not using) use timer 0
micros()
function doesn't actually rely on a timer (but millis does)
If i call
TCCR1B |= (1 << CS11) | (1 << CS10);
in setup()
.
The micros function will start reporting sporadic values after about 0.25s. E.g. the micros() will increase at a very low rate after that, and often go backwards.
I'm testing on an Arduino Uno.
I'm also trying to check if the timer interrupt being called might be too heavy. It's not doing anything much except some integer maths and one digitalWrite.