I'm using ATtiny44 with Arduino IDE according to this tutorial: http://highlowtech.org/?p=1695
I have a problem with millis()
. When I use an internal 1 MHz clock it works correctly but when I use external 16 MHz clock it takes millis()
much more time than one second to be divisible by 1000.
I tested it with LCD and Hello World sketch, modified to correspond ATtiny's pins. Do millis()
actually work with Tiny's?
Why does it work properly with 1MHz and not with 16 MHz which is the same as used in Arduino platform.
millis()
is divisible by 1000 is a terrible idea. With a 16 MHz clock millis does not count every millisecond: it is updated only every 1024 µs and occasionally jumps by 2 ms. – Edgar Bonet Jul 13 '16 at 9:41