Nachtrag Zeitschleifen für 16Mhz
zeitschleifen_16Mhz.asm
Code:
;************************zeitschleifen******************************************
wait1us:nop
ret
wait6us:push xh
push xl
ldi xh,$00
ldi xl,$0f
rjmp z_loop2
wait9us:push xh
push xl
ldi xh,$00
ldi xl,$19
rjmp z_loop2
wait10us:
push xh
push xl
ldi xh,$00
ldi xl,$1c
rjmp z_loop2
wait25us:
push xh
push xl
ldi xh,$00
ldi xl,$4c
rjmp z_loop2
wait50us:
push xh
push xl
ldi xh,$00
ldi xl,$9c
rjmp z_loop2
wait55us:
push xh
push xl
ldi xh,$00
ldi xl,$ac
rjmp z_loop2
wait58us:
push xh
push xl
ldi xh,$00
ldi xl,$b6
rjmp z_loop2
wait60us:
push xh
push xl
ldi xh,$00
ldi xl,$bc
rjmp z_loop2
wait64us:
push xh
push xl
ldi xh,$00
ldi xl,$c9
rjmp z_loop2
wait70us:
push xh
push xl
ldi xh,$00
ldi xl,$dc
rjmp z_loop2
wait100us:
push xh
push xl
ldi xh,$01
ldi xl,$3c
rjmp z_loop2
wait500us:
push xh
push xl
ldi xh,$06
ldi xl,$3a
rjmp z_loop2
wait1ms:push xh
push xl
ldi xh,$0c
ldi xl,$78
rjmp z_loop2
wait10ms:push xh
push xl
ldi xh,$7c
ldi xl,$cc
rjmp z_loop2
wait150ms:
ldi temp0,$0f
rjmp waitx10ms
wait750ms:
ldi temp0,$4b
rjmp waitx10ms
wait1s: ldi temp0,$64
rjmp waitx10ms
z_loop2:sbiw xh:xl,$01
cpi xl,$00
brne z_loop2
cpi xh,$00
brne z_loop2
pop xl
pop xh
ret
waitxms:rcall wait1ms
dec temp0
brne waitxms
ret
waitx10ms:
rcall wait10ms
dec temp0
brne waitx10ms
ret
Lesezeichen