Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #INCLUDE "P16F84A.INC"
- __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF
- ERRORLEVEL -302
- ORG 0x00
- GOTO START
- ORG 0x04
- GOTO START
- START
- ;----------------------------------------------------------
- ; register configurations
- BSF STATUS, RP0
- MOVLW 0x00
- MOVWF TRISB
- MOVLW 0x07
- MOVWF OPTION_REG
- BCF STATUS, RP0
- CLRF PORTB
- MAIN
- ;---------------------------------------------------------
- ; start of the program
- MOVLW 0xF0
- MOVWF PORTB
- CALL DELAY
- MOVLW 0x0F
- MOVWF PORTB
- CALL DELAY
- GOTO MAIN
- DELAY
- ;---------------------------------------------------------
- ; create a delay
- CLRF TMR0
- LOOP
- MOVF TMR0, 0
- XORLW D'255'
- BTFSS STATUS, Z
- GOTO LOOP
- RETLW 0x00
- END
Advertisement
Add Comment
Please, Sign In to add comment