Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list p=16F877A, r=dec, w=-302
- include <P16F877A.INC>
- __config b'10100100000011'
- cblock 0x20
- COUNT1
- COUNT2
- endc
- org 0x000
- goto START
- START clrf PORTA ;init all ports
- clrf PORTB
- clrf PORTC
- clrf PORTD
- clrf PORTE
- banksel ADCON1 ;bank 1
- movlw 6 ;all pins digital I/O
- movwf ADCON1
- clrf TRISA ;all ports output
- clrf TRISB
- clrf TRISC
- clrf TRISD
- clrf TRISE
- banksel 0 ;bank 0
- movlw 1 ;toggle LED on RA0 forever
- xorwf PORTA,F
- call Delay
- goto $-3
- Delay movlw 0xFF
- movwf COUNT1
- decfsz COUNT1,F
- goto $-1
- decfsz COUNT2,F
- goto $-3
- return
- end
Add Comment
Please, Sign In to add comment