Advertisement
Guest User

Untitled

a guest
Aug 5th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include "p10f322.inc" ; processor specific variable definitions
  2. __CONFIG _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF & _LVP_OFF & _CP_OFF & _BOREN_OFF
  3. #DEFINE LED1 LATA,0
  4. #DEFINE LED2 LATA,1
  5. CBLOCK 0x40 ; blok definice proměnných (20h-7Fh, 96 bytes)
  6. DELAY,D1,D2,D3,D4 ; pro zpožďovací smyčky
  7. ENDC
  8.  
  9. org 0x0
  10. movlw b'00010000' ; for 250-kHz (default 8MHz -1100-00)
  11. movwf OSCCON ; nastavení vnitřního oscilátoru
  12. clrf LATA ; init LATA
  13. clrf ANSELA ; xxxxxRA<2:0>; 1=an, 0=dig (default -----111)
  14. clrf TRISA
  15. MAIN bsf LED1
  16. bsf LED2
  17. call WAIT100ms
  18. call WAIT100ms
  19. call WAIT100ms
  20. call WAIT100ms
  21. bcf LED1
  22. bcf LED2
  23. call WAIT100ms
  24. call WAIT100ms
  25. call WAIT100ms
  26. call WAIT100ms
  27. goto MAIN ; nekonečná smyčka
  28.  
  29. WAIT100ms movlw 0xE1
  30. movwf D1
  31. movlw 0x05
  32. movwf D2
  33. decfsz D1,F
  34. goto $+2
  35. decfsz D2,F
  36. goto $-3
  37. return
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement