DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

TB025 데이터 시트보기 (PDF) - Microchip Technology

부품명
상세내역
제조사
TB025 Datasheet PDF : 8 Pages
1 2 3 4 5 6 7 8
TB025
LISTING 2:
HEX DOWNLOAD CODE WRITTEN FOR MPASM
list p=16f877
#include "c:\progra~1\mplab\p16f877.inc"
DownloadCode
banksel
DCStart
call
movlw
subwf
btfss
goto
RCREG
GetByte
':'
RCREG,W
STATUS,Z
DCStart
call
movwf
movwf
bcf
rrf
GetHex8
ByteCount
LineChecksum
STATUS,C
ByteCount,F
call
movwf
addwf
call
movwf
addwf
GetHex8
AddrH
LineChecksum,F
GetHex8
AddrL
LineChecksum,F
call
movwf
addwf
GetHex8
RecType
LineChecksum,F
DataRec
movf
btfss
goto
DRLoop
movf
btfsc
goto
call
movwf
addwf
call
movwf
addwf
RecType,F
STATUS,Z
EndOfFileRec
ByteCount,F
STATUS,Z
DRCkChecksum
GetHex8
HexDataL
LineChecksum,F
GetHex8
HexDataH
LineChecksum,F
WriteDataSequence
banksel
movf
movwf
movf
movwf
movf
movwf
movf
movwf
banksel
bsf
bsf
bcf
movlw
movwf
movlw
movwf
bsf
nop
EEADRH
AddrH,W
EEADRH
AddrL,W
EEADR
HexDataH,W
EEDATH
HexDataL,W
EEDATA
EECON1
EECON1,EEPGD
EECON1,WREN
INTCON,GIE
0x55
EECON2
0xaa
EECON2
EECON1,WR
;Uses USART to receive data from PC
;Wait for colon
;Read byte count
;Store in register
;Store in line checksum
;Divide byte counter by 2 to get words
;Read high byte of 16-bit address
;Add high byte to line checksum
;Read low byte of 16-bit address
;Add low byte to line checksum
;Read record type
;Add to line checksum
;Data reception
;Check for data record (0h)
;Otherwise check for EOF
;Check for bytecount = 0
;If zero, goto checksum validation
;Read lower byte of data (2 characters)
;Add received data to checksum
;Read upper byte of data (2 characters)
;Add received data to checksum
;Write sequence to internal prog. mem FLASH
;Write address to EEADRH:EEADR registers
;Write data to EEDATH:EEDATA registers
;Write sequence
;Set EEPGD to indicate program memory
;Enable writes to memory
;Make sure interrupts are disabled
;Required write sequence
;Start internal write cycle
DS91025A-page 4
© 1998 Microchip Technology Inc.

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]