LIST P=PIC16F877
#INCLUDE
__CONFIG _BODEN_ON& _WDT_OFF& _PWRTE_ON & _XT_OSC
JJ EQU 30H
MM EQU 31H
ORG 0000H
GOTO MAIN
ORG 0010H
MAIN: CLRWDT
BCF STATUS,RP1
BSF STATUS,RP0
MOVLW B'11001111'
MOVWF OPTION_REG
MOVLW B'11010111'
MOVWF TRISC
CLRF SSPSTAT
BCF STATUS,RP0
MOVLW B'00110010'
MOVWF SSPCON
MOVLW B'10101010'
MOVWF SSPBUF
BSF STATUS,RP0
LOOP: BTFSS SSPSTAT,BF
GOTO LOOP
BCF STATUS,RP0
DELAY1S:MOVLW .100
MOVWF JJ
BB: CLRWDT
MOVLW .255
MOVWF MM
AA: DECFSZ MM,1
GOTO AA
DECFSZ JJ,1
GOTO BB
MOVF SSPBUF,W
END