TB025 Microchip Technology, TB025 Datasheet - Page 5
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
TB025
Manufacturer Part Number
TB025
Description
Microcontrollers
Manufacturer
Microchip Technology
Datasheet
1.TB025.pdf
(8 pages)
www.DataSheet4U.com
DRCkChecksum
EndOfFileRec
GetByte
; Insert your code here to retrieve a byte of data from
; the desired interface. In this case it is the USART on F877.
;clear CTS
;
;GH4Waitbtfss
;
;set CTS
GetHex8
1998 Microchip Technology Inc.
nop
bcf
banksel
bsf
bsf
bcf
nop
movf
subwf
btfss
retlw
movf
subwf
btfss
retlw
incf
btfsc
incf
decf
goto
call
addwf
btfss
retlw
goto
decf
btfss
goto
call
addwf
btfss
retlw
retlw
banksel
goto
nop
banksel
movf
return
call
call
movwf
swapf
call
call
iorwf
movf
return
PIR1
PIR1,RCIF
GH4Wait
EECON1,WREN
EECON1
EECON1,EEPGD
EECON1,RD
STATUS,RP0
EEDATH,W
HexDataH,W
STATUS,Z
0xff
EEDATA,W
HexDataL,W
STATUS,Z
0xff
AddrL,F
STATUS,Z
AddrH,F
ByteCount,F
DRLoop
GetHex8
LineChecksum,W
STATUS,Z
1
DCStart
RecType,W
STATUS,Z
DCStart
GetHex8
LineChecksum,W
STATUS,Z
1
0
RCREG
RCREG,W
GetByte
ASCII2Hex
Temp
Temp,F
GetByte
ASCII2Hex
Temp,F
Temp,W
;End of File record (01h)
;If EOF record, decrement should = 0
;Not valid record type, wait for next :
;Read in checksum
;Add to calculated checksum
;Result should be 0
; If not return 1 to indicate checksum fail
;Otherwise return 0 to indicate success
;This function uses the USART
;Read a character from the USART
;Convert the character to binary
;Store result in high nibble
;Read a character from the USART
;Convert the character to binary
;Store result in low nibble
;Move result into WREG
;Disable writes
;Read sequence
;Set EEPGD to indicate program memory
;Enable reads from memory
;Compare memory value to HexDataH:HexDataL
;If upper byte not equal, return FFh
; to indicate programming failure
;If lower byte not equal, return FFh
; to indicate programming failure
;Increment address for next iteration
;Decrement byte count
;Go back to check for ByteCount = 0
;Checksum verification
;Read in checksum
;Add to calculated checksum
;Result should be 0
; If not return 1 to indicate checksum fail
;Do it again
DS91025A-page 5
TB025