Friends, how do I know the values of the Timer 0 registers in ATtiny85, being the core ATTinyCore Universal and using the millis() function?
One popular approach is to write a program to print the values on the serial monitor, e.g.
Serial.println(TCCR0A, HEX);
I already did that but I found it strange that the TCCR0A = 0x03 and TCCR0B = 0x03, this is operating in Fast PWM mode with a pre-scale of 64, with the count up to 255, this is 2.048ms and not 1ms.
The core code is all open source, so feel free to satisfy your curiosity!
Hint: on the Arduino Uno, the timer tick is not exactly 1 ms, either. So there is more to millis() than you might suspect.
Yes, it's not 1ms, but 2ms I think would be too much.
Now I want to know in which file is this timer 0 configuration
Source code for millis is here
initialization of timers is done in init(), which is called before setup() and loop()
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.