Advertisement
jh_elec

Untitled

Sep 7th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. .include <m32def.inc>
  3. .equ fc = 16000000 ; Prozessortakt (default)
  4.  
  5.  
  6. .cseg
  7.  
  8. .def tmp = R16
  9. .def tgl = R17
  10. .def cnt = R18
  11.  
  12. init:
  13.         ldi tmp , 1<<6
  14.         out DDRC , tmp
  15.  
  16. tgRel:
  17.         ldi tgl , 1<<6
  18.         eor tmp , tgl
  19.         out PORTC , tmp
  20.  
  21.         ldi r26 , LOW ( 500 );
  22.         ldi r27 , HIGH( 500 );
  23.         sbiw r26 , 1
  24.         brne Delay1ms
  25.  
  26.         rjmp tgRel
  27.  
  28. Delay1ms:
  29. .equ c1ms = 16000;
  30.     ldi R25,HIGH(c1ms)
  31.     ldi R24,LOW(c1ms)
  32.     rjmp delay
  33.  
  34.  
  35. Delay:
  36.     sbiw R24,1 ; herunter zaehlen
  37.     brne Delay ; zaehle bis Null
  38.     nop ; zusaetzliche Verzoegerung
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement