PIC microcontroller flashing program

Publisher:epsilon15Latest update time:2015-07-15 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
#INCLUDE "P16F877.inc" ;Chip model
 
   org   000h
   GOTO a1
   org   1ch
 
;************************************************
; Main program
;************************************************  
a1   
   BSF STATUS, RP0; Select body 1
   BCF STATUS,RP1  
   MOVLW 00H; Set RD port as output port
   MOVWF TRISD        
   BCF STATUS, RP0; Select body 0
   MOVLW 00H ;
   MOVWF PORTD; RD port outputs low level
   CALL M001 ; Delay
   MOVLW 0FFH ;
   MOVWF PORTD; RD port outputs high level
   CALL M001 ; Delay
   goto a1 ; execute repeatedly
;****************************************************
; Delay subroutine
;****************************************************
M001
   MOVLW 4
   MOVWF  30H
M002  MOVLW  250
   MOVWF  31H
M003  MOVLW  248
   MOVWF 32H
   DECFSZ  32H,1  
   GOTO  $-1
   DECFSZ  31H,1  
   GOTO  M003
   DECFSZ 30H, 1  
   GOTO  M002
   RETURN
;*******************************************************
; End of program
;*******************************************************   
   end
Reference address:PIC microcontroller flashing program

Previous article:PIC microcontroller 4-digit hexadecimal number divided by 4-digit hexadecimal number subroutine
Next article:PIC microcontroller digital tube program

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号