#include "tn13def.inc" .org 0x000 rjmp reset ; Reset .org 0x002 wdr ; Pin-Change Interrupt reti ;================================================================================================== ; Reset ;================================================================================================== reset: rcall init ; Initialisiere den Mikrocontroller rcall takt_38khz ; Taktfrequenz herabsetzen rcall watchdog_off ; Watchdog aus rcall schlafe ; Schlafe ein rjmp start ;================================================================================================== ; Hauptprogramm ;================================================================================================== start: rcall watchdog_on ; Watchdog an rjmp t11 ; Überspringe den nächsten Schlaf beim ersten Durchlauf nochmal: t1: rcall schlafe ; Warte auf Taste 1 t11: sbic pinb,1 rjmp t1 rcall ton_1600hz t2: rcall schlafe ; Warte auf Taste 2 sbic pinb,2 rjmp t2 rcall ton_1600hz t3: rcall schlafe ; Warte auf Taste 3 sbic pinb,3 rjmp t3 rcall ton_1600hz t4: rcall schlafe ; Warte auf Taste 4 sbic pinb,4 rjmp t4 rcall ton_3200hz rjmp nochmal ;================================================================================================== ; Prozeduren ;================================================================================================== init: ; Initialisiere den Mikrocontroller sbi acsr,acd ; Analog Comparator aus schalten sbi ddrb,0 ; Lautsprecher-Pin ist ein Ausgang ldi r16,0b00011110 ; Pull-Up an allen Tasten einschalten out portb,r16 ldi r16,(1<