First build the circuit shown below -or- hack a MiniPOV3 by adding a wire from pin 2 of the DE9 to pin 3 of the 2313.
Burn the firmware. Make sure the fuses are set for internal 8 MHz oscillator (the default it 1 MHz internal).
Configure terminal software for 9600,8,N,1.
Press 'x' (must be lower case!). The factory calibration will be shown. Continue to press 'x' to increment the OSCCAL test value.
The time shown is the async serial (RS-232) bit time in units of 0.5 uS as perceived by the microcontroller. 9600 bps has a bit time of 104 uS, so a measured time of 208 (D0 hex) indicates that the internal oscillator is very close to 8.000 MHz. The clock frequency is equal to 38462 * Time. In the example below the factory OSCCAL value of 4A resulted in clock of 8.385 MHz (4.8 % high).
The factory calibration can not be changed, so firmware must set the optimal OSCCAL value during initialization.
Assembly:
ldi temp,0x45 ; Load optimal OSCCAL value in to temp register
out OSCCAL,temp ; Set OSCCAL register
C:
OSCCAL = 0x45;


