Advertisement
jh_elec

Untitled

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