
0LFURFKLS 7HFKQRORJ\ ,QF
3UHOLPLQDU\
'6$SDJH
!
(;$03/(
3,&)[[ &RGH WR 3URJUDP WKH 'HYLFH ,' FRQWLQXHG
ctsLow
clrf
breg
; clear the offset
call
string1
; get the byte count
;
(ID length byte + # bytes in string)
movwf
creg
; use creg as the loop counter
incf
creg, f
; add 1 to the loop count since
;
we're jumping into the middle
movwf
areg
; save the count in areg to send it
goto
sndwt
; start sending the count + ID string
;
sndlp
call
string1
; get the byte
movwf
areg
; save the byte
sndwt
btfsc
cts
; check the cts input
goto
sndwt
; wait if cts=1
call
txser
; send the byte using the Transmit Routine
incf
breg,f
; increment the table pointer
decfsz
creg, f
; more bytes to send?
goto
sndlp
; YES, send more bytes
;
bcf
clr
; NO, place the MCP2155 in reset
bcf
dtr
; Force the DTR pin Low for normal mode
bsf
rts
; Force the RTS pin High for normal mode
call
delay1mS
; delay for 1 ms.
bsf
clr
; allow the MCP2155 to come out of reset
;
ctsLP2
btfss
cts
; if cts=1 then MCP2155 is in Normal mode
goto
ctsLP2
; NO, wait for MCP2155 to be ready
goto
NormalOperation ; The MCP2155 in now programmed with new ID,
; and is ready to establish an IR link