;Hearbeat LED ;(C) 2004 Markus Vohburger ;Gewerbliche Nutzung untersagt. ; ;Registerdefinitionen für Tiny12 ladan .include "tn12def.inc" .def temp1 = r16 .def temp2 = r17 .def output = r18 ;Software-Zähler .def swcount = r19 .def output = r20 ;Zähler für PWM .def pwmcount = r21 ;Richtung heller oder dunkler .def direction = r25 ;Wert für PWM .def pwmvalue = r27 ;Kalibrierbyte für internen Oszillator ist in EEPROM $3f gespeichert .equ EE_OSCCAL= $3f; ;reset-Vektor .org $0000 rjmp main ;Timer 0 Overflow Interrupt Vektor ;timer overflow interrut handler .org OVF0Addr rjmp OVF0Handler ;Hauptprogramm beginnt hier .org $0010 main: ;set internal osc cal ldi temp1,EE_OSCCAL rcall readeeprom out osccal,temp1 ;Ports Setup ldi temp1,$1f out ddrb,temp1 ldi temp1,$1f out portb,temp1 clr pwmcount clr pwmvalue clr direction ;Timer zurücksetzen clr temp1 out tcnt0,temp1 ;Timer interrupts an ldi temp1,(1<