Closed jmanncontrel closed 3 months ago
Well, delay and delayMicroseconds uses timer0 for timekeeping. If the internal oscillator is off, I'll assume it will heavily affect the timing functions as well. The delay and delayMicroseconds code is written by Arduino, and not me. I'll suggest performing an oscillator calibration (not something this core has built-in support for) or using an external oscillator instead, which is what I do for everything that requires somewhat accurate timing, like UART.
Configuring an ATMEGA328P internal clock at anything below 4MHz (2MHz or 1MHz) seems to produce inaccurate timings (beyond the inherent inaccuracy of the internal oscillator) using delay() and delayMicroseconds() functions.