AN2183 Freescale Semiconductor / Motorola, AN2183 Datasheet - Page 37

no-image

AN2183

Manufacturer Part Number
AN2183
Description
Using FLASH as EEPROM on the MC68HC908GP32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
;*
;*
;*
;*
GetChar:
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
PutHexByte:
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
;*
GetHexByte:
AN2183
MOTOROLA
Returns:
PutHexByte Subroutine
This subroutine converts the data in ACC to its two ASCII byte equivalent and outputs
them via the SCI.
Calling convention:
Returns:
Changes:
GetHexByte Subroutine
This subroutine retrieves two ASCII bytes via the SCI and converts (packs) them into one
hex byte, which is returned in ACC.
Calling convention:
Returns:
Changes:
ACC= data
sta
brclr
lda
rts
lda
jsr
psha
nsa
bsr
bsr
pula
bsr
bsr
rts
jsr
bsr
bsr
bsr
bne
bsr
nsa
psha
copctl
SCRF,scs1,GetChar
scdr
data
PutHexByte
nothing
ACC
FromHex
PutChar
FromHex
PutChar
GetHexByte
CCRZ= 1 if valid hex byte retrieved.
ACC= data
ACC
GetChar
PutChar
IsHex
GetHexByte2
ToHex
Freescale Semiconductor, Inc.
==================================================================
==================================================================
For More Information On This Product,
Go to: www.freescale.com
; clear the COP counter
; wait forever until SCI receiver is full
; get data
; return
; save ACC temporarily
; move upper nibble down
; convert it to ASCII
; output it
; retrieve data
; convert lower nibble to ASCII
; output it
; return
; get msb character from the SCI
; echo it back
; check if valid ASCII hex character
; exit if not
; convert ASCII hex character to hex value
; swap lower nibble up
; save temporarily
Otherwise, CCRZ= 0.
Application Note
eetest.asm
37

Related parts for AN2183