ATtiny13A's timer appears to be very inaccurate, is it normal?
So, you're seeing about +6% deviation, and ±0.05% jitter.

The devation.

I couldn't find anything on the internal 128kHz oscillator, but the 4.8/9.6 MHz internal oscillator has a default accuracy of ±10% at a specified voltage and temperature. See section 18.4.1 (page 119) of the datasheet:



I suspect the 128kHz oscillator to be similar, so I suspect +6% is in-spec to me. You can calibrate the internal oscillator to get better accuracy, see Atmel appnote AVR053: Internal RC Oscillator Calibration for tinyAVR and megaAVR Devices.

You should also look at the way you're using the timer; You have no interrupt handler defined, so I believe you're causing a soft-reset of the tiny when the timer expires. This means any avr-glibc initialization code is re-run, as is your timer setup code. This will take some cycles and increase your cycle time, causing a positive deviation.

Try setting up an ISR which does the blinking, and see if that makes a difference. Or even try a calibrated delay loop instead of the timer.

The jitter.

As for the jitter, ±0.05% sounds like quite a lot to me. But to be honest, I'm not sure exactly how stable those RC oscillators are.

A significant suspect is your println() and serial transmit. println() has to do a fair bit of work converting your number to base-10, and the exact amount of work depends on the number being printed. Also, the serial transmit has to sync up with your computer and this may cause delays that are semi-random to your Arduino.

Try storing 20 or so measurements in memory and only using Serial.println() on them after all measurements are finished.

Also, I'm not entirely sure how accurate Arduino's micros() is. Maybe there's an accuracy problem there. If you have access to an oscilloscope, you could use that to measure the tiny's output frequency instead, cutting out the Arduino as a possible source of errors.

Update! LED power draw influences RC oscillator?

Aha, I noticed a pattern in your jitter! You are measuring 10636xx and 10626xx in an alternating fashion. So most of your jitter is a 1ms variation between even and odd cycles.

I suspect this may be because you're turning on an LED, which draws current, which affects the resonance in the RC tank used for the internal oscillator. That would be interesting.

Can you try repeating your original measurement run two more times, once without the LED, and once with?

If removing the LED makes the problem go away, you might want to use lots of decoupling on the tiny, and avoid having the tiny drive loads directly but always buffer outputs with transistors. If the clock accuracy is important enough for the situation, anyway.