;*************************************************** ; Zeitschleifen Zeiten ; Rev.: 04042018 ; ;*************** Verzoegerungsschleifen fuer LCD ************ ; wait1: ; Anzahl Takte push xl ; 2 push xh ; 2 push temp ; 2 push temp1 ; 2 push temp2 ; 2 in temp2, SREG ; 1 push temp2 ; 2 ldi xl, low(zeit0) ; 1 ldi xh, high(zeit0) ; 1 rjmp repeatx ; 2 ; repeatx: ; 16-Bit-Subtraktionsschleife: sbiw xl:xh, 1 ; 2 x Konstante brne repeatx ; 2 (1) pop temp2 ; 2 out SREG, temp2 ; 1 pop temp2 ; 2 pop temp1 ; 2 pop temp ; 2 pop xh ; 2 pop xl ; 2 ;----------------------- ; 32 + 2 x (Konstante) -1 = ; bei 4 MHz 1 Takt = 250 ns ; Konstante 512: 32 + 1024 -1 = 1055 =>263,75 us ; Konstante 65535 32 + 131070 -1 = 131101 => 32,8 ms ; bei 4,096 MHz 1 Takt = 244,1 ns ; Konstante 512: 257,5 us ; Konstante 65535: 32 ms