PIC programming are being try and study
This is my Blog and share with difference life style and what we doing.
t
To day I was try to programming the interrupt with bootloader with http://www.microchipc.com/.







The site did not said how to write with interrupt, so I try and error with long time and get the following code:









list p=16f877A ; list directive to define processor

#include

MOVF PORTC_B,W

MOVWF PORTC

JUMP1

MOVLW TMR0_B

MOVWF TMR0

MOVF W_TEMP,W

RETFIE

MAIN

BSF STATUS,RP0

MOVLW 00H

MOVWF TRISC

MOVLW 07H

MOVWF OPTION_REG

BCF STATUS,RP0

MOVLW 0A0H

MOVWF INTCON

BCF INTCON,T0IF

MOVLW TMR0_B

MOVWF TMR0

MOVLW B'10000000'

MOVWF PORTC_B

LOOP

CALL DELAY

RRF PORTC_B,F

BTFSS STATUS,0

GOTO LOOP

MOVLW B'10000000'

MOVWF PORTC_B

GOTO LOOP

;******************************************

DELAY

MOVLW 0FH

MOVWF 20H

LP0

MOVLW 0AFH

MOVWF 21H

LP1

DECFSZ 21H,1

GOTO LP1

DECFSZ 20H,1

GOTO LP0

RETURN

END





2006-08-22 16:00:06 GMT
Comments (0 total)
Compose a comment for this post.
Comment:
0 characters left (limit 4,000 characters). No HTML permitted.
Word verification:
To validate this comment, showing us that you are human, and not a computer, please retype the following code in the field provided.
(This helps prevent blog spam.)
1