//====================================================== // (c)2008-9 Matthew Ford // Forward Computing and Control Pty. Ltd. // www.forward.com.au // All rights reserved // // You may freely copy and distribute this program for // commercial and non-commercial use provided:- // i) this copyright notice remains attached // ii) you clearly mark any changes you make to the code //====================================================== .include "tn84def.inc" .def Temp = r16 .def Temp2 = r15 //************************************************************************* // // PROGRAM START - EXECUTION STARTS HERE // Before running this program // i) use the AVR Dragon programming Fuses to turn on CKOUT // ii) use the AVR Dragon programming Advance tab to Read to clock calibration byte // iii) Conect a Frequency meter to PB2 and read the clock frequency // Then set ldi Temp value below and program the uC and check the frequency // adjust as necessary by no more then 0x20 each step, use more then one // step if necessary to get to the required value. // See Typical characteristics in the Attiny 84 specs for // osc values versus frequency // between -20degC and +80degC the freq varies by +/-0.2Mhz (+/-2.5%) // so if you calibrate for 8Mhz at 25degC you will be well within the // +/-4% over this temperature range // //************************************************************************* .cseg // INTERRUPT VECTORS .org 0x0000 rjmp RESET RESET: // set clock to 8Mhz i.e. remove div8 that is set by programmer ldi Temp, (1<