Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list p=16F887, r=dec, w=1
- include <P16F887.INC>
- __config _CONFIG1,_LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF & _PWRTE_ON & _WDT_OFF & _INTOSCIO
- __config _CONFIG2,_WRT_HALF & _BOR21V
- #define LED0 PORTD,0
- cblock 0x20
- COUNT1
- COUNT2
- endc
- org 0x000 ;reset vector
- goto START
- START clrf PORTA ;init ports
- clrf PORTB
- clrf PORTC
- clrf PORTD
- clrf PORTE
- banksel ANSEL ;bank 3
- movlw b'00000000' ;all ports digital I/O
- movwf ANSEL
- movwf ANSELH
- banksel TRISA ;bank 1
- movlw b'00000000' ;all ports output
- movwf TRISA
- movwf TRISB
- movwf TRISC
- movwf TRISD
- movwf TRISE
- banksel 0x00 ;bank 0
- movlw b'00000001'
- xorwf PORTD,F
- call DELAY
- goto $-2
- DELAY movlw 0xFF
- movwf COUNT1
- movwf COUNT2
- decfsz COUNT1,F
- goto $-1
- decfsz COUNT2,F
- goto $-3
- return
- end
Add Comment
Please, Sign In to add comment