Guest User

Untitled

a guest
Apr 8th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MPASM 0.67 KB | None | 0 0
  1.         list        p=16F877A, r=dec, w=-302
  2.         include     <P16F877A.INC>
  3.         __config    b'10100100000011'
  4.  
  5.         cblock      0x20
  6.                 COUNT1
  7.                 COUNT2
  8.         endc
  9.  
  10.         org     0x000
  11.         goto        START
  12.  
  13. START       clrf        PORTA           ;init all ports
  14.         clrf        PORTB
  15.         clrf        PORTC
  16.         clrf        PORTD
  17.         clrf        PORTE
  18.         banksel     ADCON1          ;bank 1
  19.         movlw       6           ;all pins digital I/O
  20.         movwf       ADCON1
  21.         clrf        TRISA           ;all ports output
  22.         clrf        TRISB
  23.         clrf        TRISC
  24.         clrf        TRISD
  25.         clrf        TRISE
  26.         banksel     0           ;bank 0
  27.  
  28.        
  29.         movlw       1           ;toggle LED on RA0 forever
  30.         xorwf       PORTA,F
  31.         call        Delay
  32.         goto        $-3
  33.  
  34. Delay       movlw       0xFF
  35.         movwf       COUNT1
  36.         decfsz      COUNT1,F
  37.         goto        $-1
  38.         decfsz      COUNT2,F
  39.         goto        $-3
  40.         return
  41.  
  42.         end
Add Comment
Please, Sign In to add comment