
!
'6$SDJH
3UHOLPLQDU\
0LFURFKLS 7HFKQRORJ\ ,QF
(;$03/(
3,&)[[ &RGH WR 3URJUDP WKH 'HYLFH ,'
;#define
dtr
PORTx, Pinx
; Must specify which Port and Which Pin
;#define
cts
PORTx, Pinx
; Must specify which Port and Which Pin
;#define
rts
PORTx, Pinx
; Must specify which Port and Which Pin
;#define
clr
PORTx, Pinx
; Must specify which Port and Which Pin
;
;*****************************************************************
; String Table
; This table stores a string, breg is the offset.
The string
; is terminated by a null character.
;*****************************************************************
string1 clrf
PCLATH
; this routine is on page 0
movf
breg, W
; get the offset
addwf
PCL, F
; add the offset to PC
DT
D'15'
; the first byte is the byte count
DT
"My IR ID String"
;
UpdateID
call
deviceInit
; Initialize the PIC16Fxxx
bcf
clr
; place the MCP2155 in reset
bsf
dtr
; Force the DTR pin High for program mode
bcf
rts
; Force the RTS pin Low for program mode
call
delay1mS
; delay for 1 ms.
bsf
clr
; allow the MCP2155 to come out of reset
;
clrf
LoopCnt
; LoopCnt = 0
ctsLP1
call
delay1mS
; delay for 1 ms.
btfss
cts
; if cts=0 then we're ready to program
goto
ctsLow
; MCP2155 is ready to receive data
decfsz LoopCnt, F
;
goto
ctsLP1
; NO, wait for MCP2155 to be ready
goto
StuckReset
; The MCP2150 did not exit reset, do your recovery
;
in this routine.