ich konstruiere jeden Tag zu den Übungen Schaltwerke

Um die Schaltwerke richtig zu verwenden, nehme ich einen Zähler, der die Zustände zählt

.include "m8def.inc"

ldi r16, HIGH (RAMEND)
out SPH, r16
ldi r16, LOW (RAMEND)
out SPL, r16


ldi r16, 0xff
out DDRD, r16


ldi r16, 4
loop1:
out PORTD, r16
rcall sleep
inc r16
cpi r16, 0x0a
brlt loop1
ldi r16, 0x00
rjmp loop1

loopend: rjmp loopend

sleep:
push r16
push r17
push r18

ldi r16, 1
sleeploop1:
inc r16
ldi r17, 1
sleeploop2:
inc r17
ldi r18, 1
sleeploop3:
inc r18
cpi r18, 0x2f
brlt sleeploop3
cpi r17, 0x2f
brlt sleeploop2
cpi r16, 0x2f
brlt sleeploop1

pop r18
pop r17
pop r16
ret
Image IMG_3658

Image IMG_3659

Image IMG_3660

Image IMG_3661

Image IMG_3662

Image IMG_3663

Image IMG_3664

Image IMG_3665

Image IMG_3666

Image IMG_3667

Image IMG_3668

Image IMG_3669

Image IMG_3670

Image IMG_3671

Image IMG_3672

Image IMG_3673

Image IMG_3674

Image IMG_3675

Image IMG_3676

Image IMG_3677

Image IMG_3678

https://www.ituenix.de/html/vid/IMG_3679.mov