Hallo,
so lautet meine Routine zum entprellen. measure ist die
Interrupt-Routine, zu welcher gesprungen wird, wenn der ext. Interrupt
ausgeloest wird.
measure:
cli ; deaktiviere Interrupt
push XL ; sichere Zeiger
push XH
push ZL
push ZH
push all0 ; sichere Register
push all1
push all2
push all3
push all4
push all5
push all6
push all7
push all8
push all9
push cou0
push lcd0
push men0
in all0, SREG ; sichere SREG (Flags)
push all0
in all0, TCNT0 ; sichere TCNT0
push all0
ldi cou0, 98 ; Test ob Prellen, dazu setze
Zaehler ca. 30ms
rcall delay ; teste on Prellen oder wirklich
Interrupts durch Warten
sbic PIND, 2 ; ueberspringe, wenn noch
gedrueckt
rcall measure_end ; sonst kein Signal und Abbruch
****** Beginn Programm fuer Interrupt ******
Ich verwende den Taster mit Pullup. Ich kann soweit keinen Fehler
erkennen.
Danke und ade,
Thomas H.