Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. d1 EQU 0x22
  2.     X EQU 0x30 ;задержка
  3.     Y EQU 0x32 ;задержка
  4.     A EQU 0x34 ;задержка
  5.  
  6.     ORG 0x0000
  7.     BCF PCLATH,3
  8.     BCF PCLATH,4
  9.     GOTO L0001
  10.     ORG 0x0004
  11.     RETFIE
  12. L0001:
  13.      ; конфигурация портов
  14.     bsf status,5
  15.     bcf trisb,0
  16.     bcf trisb,1
  17.     bcf trisb,2
  18.     bcf trisb,3
  19.     bcf trisb,4
  20.     bcf trisb,5
  21.     bcf trisb,6
  22.     bcf trisb,7
  23.     bcf status,5
  24.     goto start
  25.   ;задержка
  26. delay:
  27.     MOVLW 0x48
  28.     MOVWF a
  29. mz3:
  30.     MOVLW 0x2E
  31.     MOVWF y
  32. mz2:
  33.     MOVLW 0x64
  34.     MOVWF X
  35. mz1:
  36.     DECFSZ x,f
  37.     GOTO mz1   
  38.     DECFSZ y,f
  39.     GOTO mz2
  40.     DECFSZ a,f
  41.     GOTO mz3
  42.     RETURN
  43.      ;основная программа
  44. start:
  45.     bsf portb,7
  46.     call delay
  47.     bcf portb,6
  48.     call delay
  49.     bcf portb,5
  50.     call delay
  51.     bcf portb,4
  52.     call delay
  53.     bcf portb, 3
  54.     call delay
  55.     bcf portb, 2
  56.     call delay
  57.     bcf portb, 1
  58.     call delay
  59.     bcf portb, 0
  60.     goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement