Advertisement
Looong

TN VXL 2-1

Mar 9th, 2016
2,701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MPASM 0.93 KB | None | 0 0
  1.         list    p=PIC18f8722
  2.         #include p18f8722.inc
  3.         CONFIG  OSC = HS, WDT = OFF, LVP = OFF
  4.         #define LED LATD
  5.         #define LED_IO TRISD
  6. ; Begin
  7.         code    0
  8.         goto    initialize
  9. ; Memory mapping
  10.         udata
  11. counter res     .3
  12. ; Start
  13.         PRG code
  14. initialize    
  15.         clrf    LED_IO
  16.         clrf    LED
  17. main    incf    LED
  18.         call    delay_500ms
  19.         bra     main
  20.  
  21. delay_400us
  22.         movlw   .249
  23.         movwf   counter
  24.         nop
  25. delay_400us_loop
  26.         nop
  27.         decfsz  counter
  28.         bra     delay_400us_loop
  29.         return
  30.  
  31. delay_500ms
  32.         movlw   .5
  33.         movwf   counter + 1
  34. delay_500ms_loop1
  35.         movlw   .250
  36.         movwf   counter + 2
  37. delay_500ms_loop2
  38.         call    delay_400us
  39.         decfsz  counter + 2
  40.         bra     delay_500ms_loop2
  41.         decfsz  counter + 1
  42.         bra     delay_500ms_loop1
  43.         return
  44.  
  45.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement