Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .include <m32def.inc>
- .equ fc = 16000000 ; Prozessortakt (default)
- .equ fck = fc / 1000 ; Taktfrequenz in kHz
- .cseg
- .def tmp = R16
- .def tgl = R17
- init:
- ldi tmp , 1<<6
- out DDRC , tmp
- tgRel:
- ldi tgl , 1<<6
- eor tmp , tgl
- out PORTC , tmp
- rjmp Delay100ms
- rjmp tgRel
- Delay1ms:
- .equ c1ms = (1000*fck)/4000 - 1 ;
- ldi R25,HIGH(c1ms)
- ldi R24,LOW(c1ms)
- rjmp delay
- ;
- Delay100ms: ; 100 ms Routine
- .equ c100ms = (100*fck)/4 - 1
- ldi R25,HIGH(c100ms)
- ldi R24,LOW(c100ms)
- rjmp delay
- Delay:
- sbiw R24,1 ; herunter zaehlen
- brne Delay ; zaehle bis Null
- nop ; zusaetzliche Verzoegerung
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement