PIC單片機(jī)lcd顯示時(shí)鐘演示程序
include
;*----
;定義LCD數(shù)據(jù)&控制I/O口
LCD_DATAequPORTB
LCD_CNTL1equPORTB
LCD_CNTL2equPORTA
;定義LCD控制相應(yīng)的I/O引腳
RSequ1
Eequ5
;LCD模塊命令
DISP_ONEQU0x00C;開(kāi)顯示
DISP_ON_CEQU0x00E;開(kāi)顯示,開(kāi)指針
DISP_ON_BEQU0x00F;開(kāi)顯示,開(kāi)指針,開(kāi)閃爍
DISP_OFFEQU0x008;關(guān)顯示
CLR_DISPEQU0x001;清顯示的操作數(shù)
ENTRY_INCEQU0x006;操作數(shù)
ENTRY_INC_SEQU0x007;操作數(shù)
ENTRY_DECEQU0x004;操作數(shù)
ENTRY_DEC_SEQU0x005;操作數(shù)
DD_RAM_ADDREQU0x080;初始化第一行顯示的操作數(shù)
DD_RAM_ULEQU0x0c0;初始化第二行顯示的操作數(shù)
;設(shè)置顯示相關(guān)寄存器
ByteEQU20H
CountEQU21H
Count1EQU22H
Count2EQU23H
LCD_DATA1EQU24H
PORTDBEQU25H
TempEQU26H
TempHEQU27H
TempLEQU28H
INTSIGEQU29H
RTCCSIG1EQU2AH
RTCCSIGEQU2BH
ALRSIGEQU2CH
HourEQU2DH
HourHEQU2EH
HourLEQU2FH
HourL1EQU30H
HourH1EQU31H
MinsEQU32H
Mins1EQU33H
MinsHEQU34H
MinsLEQU35H
MinsH1EQU36H
MinsL1EQU37H
SecsEQU38H
SecsHEQU39H
SecsLEQU3AH
ALRH1EQU3BH
ALRM1EQU3CH
ALRH2EQU3DH
ALRM2EQU3EH
ALRH3EQU3FH
ALRM3EQU40H
_WREGEQU41H
_STATUSEQU42H
Hour1EQU43H
ADRESBEQU44H
BKMEQU45H
;*----
org0
nop
gotostart
org4
gotoISR
org10
CalTable
bcfSTATUS,RP0
bcfPCLATH,0
movlw0x66;進(jìn)行校準(zhǔn)處理
subwfTemp,w;
addwfPCL,f;將補(bǔ)償結(jié)果與PCL相加
dt0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5
dt6,6,6,7,7,7,8,8,8,9,9,0xa,0xa,0xb,0xb,0xc,0xc
dt0xd,0xd,0xe,0xe,0xf,0xf,0xf,0x10,0x10,0x10
dt0x11,0x11,0x12,0x12,0x12,0x13,0x13,0x14,0x14,0x14
dt0x15,0x15,0x15,0x16,0x16,0x16,0x17,0x17,0x18,0x18
dt0x19,0x19,0x1a,0x1a,0x1b,0x1b,0x1c,0x1c,0x1c
dt0x1d,0x1d,0x1d,0x1e,0x1e,0x1f,0x1f,0x20,0x20
dt0x21,0x21,0x22,0x22,0x23,0x23,0x24,0x24,0x25,0x25
dt0x26,0x26,0x27,0x28,0x29,0x29,0x2a,0x2a,0x2b,0x2b
dt0x2c,0x2d,0x2e,0x2f,0x30,0x32
start
callInitLCD
clrfRTCCSIG
clrfRTCCSIG1
clrfINTSIG
clrfHour
clrfHour1
clrfMins
clrfMins1
clrfSecs
clrfALRSIG
movlw20h
movwfBKM
movlwb'10001111'
movwfPORTDB
movlw0ffh
movwfTMR0
movlw00
movwfTMR1L
movlw80h
movwfTMR1H
movlwb'00001111'
movwfT1CON
bsfSTATUS,RP0
bsfPIE1,TMR1IE
bcfSTATUS,RP0
movlwb'10111111'
OPTION
movlwb'11110000'
movwfINTCON
main
movlw80h
callSendCmd
callDisplayTime;顯示時(shí)間
movlw0c0h
callSendCmd
movlw'H'
callputcLCD
movlw'e'
callputcLCD
movlw'l'
callputcLCD
movlw'l'
callputcLCD
movlw'o'
callputcLCD
movlw''
callputcLCD
movlw'!'
callputcLCD
movlw''
callputcLCD
movlw':'
callputcLCD
movlw')'
callputcLCD
movlw''
callputcLCD
movlw''
callputcLCD
callBkLight;背光控制
callTempM;顯示溫度
btfscALRSIG,1
callALR1
btfscALRSIG,2
callALR2
btfscALRSIG,3
callALR3
bcfSTATUS,RP0
bcfPCLATH,0
movfRTCCSIG,W
addwfPCL,1
gotomain
gotoRtccS1
gotoRtccS2
gotoRtccs3
gotoRtccs4
clrfRTCCSIG
clrfRTCCSIG1
gotomain
;*=====
ALR1bcfSTATUS,RP0
movfHour,W
xorwfALRH1,W
btfssSTATUS,Z
gotoALREND
movfMins,W
xorwfALRM1,W
btfssSTATUS,Z
gotoALREND
bsfSTATUS,RP0
clrfTRISD
bcfSTATUS,RP0
bcfSTATUS,C
rlfPORTDB,1
btfscSTATUS,C
bsfPORTDB,0
movfPORTDB,W
movwfPORTD
return
;*---
ALR2bcfSTATUS,RP0
movfHour,W
xorwfALRH2,W
btfssSTATUS,Z
gotoALREND
movfMins,W
xorwfALRM2,W
btfssSTATUS,Z
gotoALREND
bsfSTATUS,RP0
clrfTRISD
bcfSTATUS,RP0
bcfSTATUS,C
rlfPORTDB,1
btfscSTATUS,C
bsfPORTDB,0
movfPORTDB,W
movwfPORTD
return
;*----
ALR3bcfSTATUS,RP0
movfHour,W
xorwfALRH3,W
btfssSTATUS,Z
gotoALREND
movfMins,W
xorwfALRM3,W
btfssSTATUS,Z
gotoALREND
bsfSTATUS,RP0
clrfTRISD
bcfSTATUS,RP0
bcfSTATUS,C
rlfPORTDB,1
btfscSTATUS,C
bsfPORTDB,0
movfPORTDB,W
movwfPORTD
return
;*---
ALREND
bsfSTATUS,RP0
movlw0ffh
movwfTRISD
return
;*=====
RtccS1
movlw80h
callSendCmd
callDisplayTime
callLongDelay
movlw0c0h
callSendCmd;line2,00
movlw'S'
callputcLCD
movlw'e'
callputcLCD
movlw't'
callputcLCD
movlw''
callputcLCD
movlw'T'
callputcLCD
movlw'i'
callputcLCD
movlw'm'
callputcLCD
movlw'e'
callputcLCD;show"SetTime"
movlw''
callputcLCD
movlw''
callputcLCD
movlw''
callputcLCD
movlw''
callputcLCD
bsfPCLATH,0
movfRTCCSIG1,W
addwfPCL,1
gotoSetHour
gotoSetMins
clrfINTSIG
incfRTCCSIG
clrfRTCCSIG1
gotomain
;*----
SetHour
movlw80h
callSelshow
movlwd'24'
subwfINTSIG,W
btfscSTATUS,C
goto$+4
movfINTSIG,w
movwfHour
gotoRtccS1
clrfINTSIG
movwfHour
gotoRtccS1
;*----
SetMins
movlw83h
callSelshow
movlwd'60'
subwfINTSIG,W
btfscSTATUS,C
goto$+4
movfINTSIG,w
movwfMins
gotoRtccS1
clrfINTSIG
movwfMins
gotoRtccS1
;*=====
RtccS2
bcfSTATUS,RP0
movlw0c0h
callSendCmd
callAlarm
movlw'1'
callputcLCD
movlw''
callputcLCD
S2movlw80h
callSendCmd
callDisplayTime
callDispTime
callLongDelay
bsfPCLATH,0
movfRTCCSIG1,W
addwfPCL,1
gotoSetAlH2
gotoSetAlM2
movfHour1,w
movwfALRH1
movfMins1,w
movwfALRM1
clrfINTSIG
clrfRTCCSIG1
incfRTCCSIG
gotomain
;*---
SetAlH2
movlw0c7h
callSelshow
movfINTSIG,W
btfssSTATUS,Z
bsfALRSIG,1
movfINTSIG,W
movwfHour1
movlwd'24'
subwfHour1,W
btfssSTATUS,C
gotoS2
clrfINTSIG
clrfHour1
gotoS2
SetAlM2
movlw0cah
callSelshow
movfINTSIG,W
btfssSTATUS,Z
bsfALRSIG,1
movfINTSIG,W
movwfMins1
movlwd'60'
subwfMins1,W
btfssSTATUS,C
gotoS2
clrfINTSIG
clrfMins1
gotoS2
;*----
Alarmmovlw'A'
callputcLCD
movlw'l'
callputcLCD
movlw'a'
callputcLCD;
movlw'r'
callputcLCD
movlw'm'
callputcLCD;
return
;*----
Selshow
callSendCmd
movlw''
callputcLCD
movlw''
callputcLCD
callLongDelay
return
;*=====
Rtccs3
bcfSTATUS,RP0
movlw0c0h
callSendCmd
callAlarm
movlw'2'
callputcLCD
movlw''
callputcLCD
S3movlw80h
callSendCmd
callDisplayTime
callDispTime
callLongDelay
bsfPCLATH,0
movfRTCCSIG1,w
addwfPCL,1
gotoSetAlH3
gotoSetAlM3
movfHour1,w
movwfALRH2
movfMins1,w
movwfALRM2
clrfINTSIG
clrfRTCCSIG1
incfRTCCSIG
gotomain
;*---
SetAlH3
movlw0c7h
callSelshow
movfINTSIG,W
btfssSTATUS,Z
bsfALRSIG,2
movfINTSIG,W
movwfHour1
movlwd'24'
subwfHour1,W
btfssSTATUS,C
gotoS3
clrfINTSIG
clrfHour1
gotoS3
SetAlM3
movlw0cah
callSelshow
movfINTSIG,W
btfssSTATUS,Z
bsfALRSIG,1
movfINTSIG,W
movwfMins1
movlwd'60'
subwfMins1,W
btfssSTATUS,C
gotoS3
clrfINTSIG
clrfMins1
gotoS3
;*=====
Rtccs4
movlw80h
callSendCmd
callDisplayTime
bcfSTATUS,RP0
movlw0c0h
callSendCmd
callAlarm
movlw'3'
callputcLCD
movlw''
callputcLCD
S4callDispTime
callLongDelay
bsfPCLATH,0
movfRTCCSIG1,w
addwfPCL,1
gotoSetAlH4
gotoSetAlM4
movfHour1,w
movwfALRH3
movfMins1,w
movwfALRM3
clrfINTSIG
clrfRTCCSIG1
incfRTCCSIG
gotomain
;*---
SetAlH4
movlw0c7h
callSelshow
movfINTSIG,W
btfssSTATUS,Z
bsfALRSIG,3
movfINTSIG,W
movwfHour1
movlwd'24'
subwfHour1,W
btfssSTATUS,C
gotoS4
clrfINTSIG
clrfHour1
gotoS4
SetAlM4
movlw0cah
callSelshow
movfINTSIG,W
btfssSTATUS,Z
bsfALRSIG,1
movfINTSIG,W
movwfMins1
movlwd'60'
subwfMins1,W
btfssSTATUS,C
gotoS4
clrfINTSIG
clrfMins1
gotoS4
;*=====
ISR
Push
movwf_WREG;存WREG狀態(tài)
swapfSTATUS,W;存STATUS
movwf_STATUS
;*----
bcfSTATUS,RP0
btfscPIR1,TMR1IF
callTimeAdj
btfscINTCON,INTF
callIntDeal
btfscINTCON,T0IF
callRtccDeal
;*----
Pop
swapf_STATUS,W;RestoreSTATUS
movwfSTATUS
swapf_WREG,F;RestoreWREGw/o
swapf_WREG,W;affectingSTATUS
retfie
;*=====
TimeAdj
bcfSTATUS,RP0
bcfPIR1,TMR1IF
movlw00h
movwfTMR1L
movlw80h
movwfTMR1H
incfSecs,1
movlwd'60'
xorwfSecs,W
btfssSTATUS,Z
gotoTE
clrfSecs
incfMins,1
movlwd'60'
xorwfMins,W
btfssSTATUS,Z
gotoTE
clrfMins
incfHour
movlwd'24'
xorwfHour,W
btfssSTATUS,Z
gotoTE
clrfHour
TE
return
;*=====
IntDeal
bcfINTCON,INTF
bsfPORTB,0
btfscPORTB,0;
goto$+5;
callDelay
bsfPORTB,0;按鍵去抖動(dòng)
btfscPORTB,0
goto$+2;/
incfINTSIG
return
;*=====
RtccDeal
bcfSTATUS,RP0
movlw0ffh;
movwfTMR0
bcfINTCON,T0IF
bsfPORTA,4
btfscPORTA,4;
gotoRtcWr;
callDelay
bsfPORTA,4;按鍵去抖動(dòng)
btfscPORTB,4
gotoRtcWr;/
movfRTCCSIG,W
sublw04h
btfssSTATUS,C
gotoWRONG
movfRTCCSIG1,W
sublw03h
btfssSTATUS,C
gotoWRONG
movfRTCCSIG,W
addwfRTCCSIG1,W
btfscSTATUS,Z
goto$+3
incfRTCCSIG1
gotoRtcWr
incfRTCCSIG
gotoRtcWr
WRONG
clrfRTCCSIG
clrfRTCCSIG1
RtcWrreturn
;*=====
BkLight
bsfSTATUS,RP0
bcfADCON1,ADFM;ADRESHall8-bit,H
bcfSTATUS,RP0
movlwb'01010001'
movwfADCON0;selectAD2,Fosc/8
decfszBKM
goto$-1
bsfADCON0,GO
btfssPIR1,ADIF
goto$-1
bcfPIR1,ADIF
;READADRES---
movfADRESH,W
movwfADRESB
bsfSTATUS,RP0
bcfTRISE,0;SELECTRE0OUTPUT
bcfSTATUS,RP0
movlwb'10000000';critICalvalueoflightness
subwfADRESB,W
btfssSTATUS,C
goto$+4;c=0,ADRESB
bsfPORTE,0;c=1,backlighton
goto$+3
bcfSTATUS,RP0
bcfPORTE,0
movlw20h
movwfBKM
return
;*=====
TempM;tempraturemeasure
bsfSTATUS,RP0
bcfADCON1,ADFM;ADRESHall8-bit
bcfSTATUS,RP0
movlwb'01001001';selectAD1,FOSC/8
movwfADCON0
decfszBKM
goto$-1
bsfADCON0,GO
btfssPIR1,ADIF
goto$-1
bcfPIR1,ADIF
;bsfSTATUS,RP0
movfADRESH,W
;bcfSTATUS,RP0
movwfTemp
callCalTable
movwfTemp
callBin2BCDT;進(jìn)行BCD碼調(diào)整
movlw08ah;從第一行的第0A個(gè)位置開(kāi)始
callSendCmd
movfTempH,W;顯示溫度
callputcLCD
movfTempL,W
callputcLCD
movlw'C';顯示“C”(表示攝氏度)
callputcLCD
movlw20h
movwfBKM
return
;************************************************
;*Bin2BCDT-將Temp寄存器內(nèi)的二進(jìn)制數(shù)轉(zhuǎn)*
;*換為相應(yīng)的ASCII碼并存為T(mén)empH:TempL的形式*
;************************************************
Bin2BCDT
bcfSTATUS,RP0
clrfTempH;Initializevariables
movfTemp,W
movwfTempL
Ttenth;Subtract10fromlowvariable
movlw.10;untilresultis<0.Oneach
subwfTempL,W;subtraction,incrementthe
btfssSTATUS,C;temperaturehighbyte.
gotoOver0
movwfTempL
incfTempH,F
gotoTtenth
Over0
movlw0x30;MakedecimalASCIIbyadding
addwfTempH,F;'0'tohighandlowbyte
addwfTempL,F
return
;*************************************************
;*DisplayTime-將顯示指針移至第一行,調(diào)用Bin2BCD*
;*子程序?qū)ecs和Mins寄存器內(nèi)的數(shù)據(jù)轉(zhuǎn)換為相應(yīng)的*
;*ASCII碼,然后送LCD顯示.*
;*************************************************
DisplayTime
bcfSTATUS,RP0
callBin2BCD;調(diào)用二進(jìn)制與bcd碼轉(zhuǎn)換子程序
movfHourH,W;顯示小時(shí)高位
callputcLCD;
movfHourL,W;顯示小時(shí)低位
callputcLCD;
movlw':'
callputcLCD;顯示':'
movfMinsH,W;顯示分鐘高位
callputcLCD;
movfMinsL,W;顯示分鐘低位
callputcLCD;
movlw':';顯示':'
callputcLCD
movfSecsH,W;顯示秒鐘高位
callputcLCD;
movfSecsL,W;顯示秒鐘低位
callputcLCD;
return
;************************************************
;*Bin2BCD-將Secs&Mins寄存器內(nèi)的二進(jìn)制數(shù)轉(zhuǎn)*
;*換為相應(yīng)的ASCII碼并存為SecsH:SecsL及*
;*MinsH:MinsL,HourH:HourL的形式.*
;************************************************
Bin2BCD
bcfSTATUS,RP0
clrfHourH;初始化變量
movfHour,W;轉(zhuǎn)換“時(shí)”
movwfHourL
Hourth;Looptosubtract10
movlw.10;fromlowbyteand
subwfHourL,W;incrementhighbyte
btfssSTATUS,C;whilelowbyteis>0
gotoNext
movwfHourL
incfHourH,F
gotoHourth
Next
clrfMinsH;初始化變量
movfMins,W;轉(zhuǎn)換“分”
movwfMinsL
Mtenth;Looptosubtract10
movlw.10;fromlowbyteand
subwfMinsL,W;incrementhighbyte
btfssSTATUS,C;whilelowbyteis>0
gotoNext1
movwfMinsL
incfMinsH,F
gotoMtenth
Next1
clrfSecsH;初始化變量
movfSecs,W;轉(zhuǎn)換“秒”
movwfSecsL
Stenth;Looptosubtract10
movlw.10;fromlowbyteand
subwfSecsL,W;incrementhighbyte
btfssSTATUS,C;whilelowbyteis>0
gotoOver
movwfSecsL
incfSecsH,F
gotoStenth
Over
movlw0x30;
addwfHourH,F;
addwfHourL,F;Add0x30('0')toall
addwfMinsH,F;variablestoconvert
addwfMinsL,F;anumber0-9toan
addwfSecsH,F;ASCIIequivalent
addwfSecsL,F;'0'to'9'
return
;*====
DispTime
bcfSTATUS,RP0
movlw0c7h
callSendCmd
callBin2BCa;調(diào)用二進(jìn)制與bcd碼轉(zhuǎn)換子程序
movfHourH1,W;顯示小時(shí)高位
callputcLCD;
movfHourL1,W;顯示小時(shí)低位
callputcLCD;
movlw':';顯示':'
callputcLCD
movfMinsH1,W;顯示分鐘高位
callputcLCD;
movfMinsL1,W;顯示分鐘低位
callputcLCD;
return
;*----
Bin2BCa
bcfSTATUS,RP0
clrfHourH1;初始化變量
movfHour1,W;轉(zhuǎn)換“時(shí)”
movwfHourL1
Hourth1;Looptosubtract10
movlw.10;fromlowbyteand
subwfHourL1,W;incrementhighbyte
btfssSTATUS,C;whilelowbyteis>0
gotoNexta
movwfHourL1
incfHourH1,F
gotoHourth1
Nexta
clrfMinsH1;初始化變量
movfMins1,W;轉(zhuǎn)換“分”
movwfMinsL1
Mtenth1;Looptosubtract10
movlw.10;fromlowbyteand
subwfMinsL1,W;incrementhighbyte
btfssSTATUS,C;whilelowbyteis>0
gotoOver1
movwfMinsL1
incfMinsH1,F
gotoMtenth1
Over1
movlw0x30;
addwfHourH1,F;
addwfHourL1,F;Add0x30('0')toall
addwfMinsH1,F;variablestoconvert
addwfMinsL1,F;anumber0-9toan
return;ASCIIequivalent
;*******************************************************************
;*LCD模塊子程序*
;*******************************************************************
;InitLCD——初始化LCD模塊*
;*******************************************************************
InitLCD
bcfSTATUS,RP0;Bank0
bcfSTATUS,RP1
clrfLCD_DATA;清LCD數(shù)據(jù)&控制位
bsfSTATUS,RP0;Bank1
movlw0xc1;設(shè)置RB1~RB5為輸出
movwfLCD_DATA
bcfTRISA,5
bcfSTATUS,RP0;
movlw0x00;
movwfLCD_DATA
bsfLCD_CNTL2,E
bcfLCD_CNTL2,E
movlw0x08;
movwfLCD_DATA
bsfLCD_CNTL2,E
bcfLCD_CNTL2,E
callLongDelay
callLongDelay
movlwb'00101000'
callSendCmd
movlwDISP_ON;開(kāi)顯示
callSendCmd
movlwENTRY_INC;設(shè)置指針移動(dòng)方式
callSendCmd
movlwDD_RAM_ADDR;設(shè)置起始地址
callSendCmd
InitLCDEnd;
bcfSTATUS,RP0;
movlwCLR_DISP;
callSendCmd
return
;*******************************************************************
;*putcLCD——將字符數(shù)據(jù)送入LCD*
;*本程序?qū)⒆址麛?shù)據(jù)分成了高半字節(jié)和低半字節(jié)分別輸入*
;*先送入的是高半字節(jié)*
;*******************************************************************
putcLCD
bcfSTATUS,RP0
movwfByte;存WREG到Byte寄存器
swapfByte,W;寫(xiě)入高半字節(jié)
movwfLCD_DATA1
rlfLCD_DATA1,1
rlfLCD_DATA1,1
movlw0x3c
andwfLCD_DATA1,1
movfLCD_DATA1,w
movwfLCD_DATA
bsfLCD_CNTL1,RS;設(shè)置為送數(shù)據(jù)模式
bsfLCD_CNTL2,E;發(fā)送數(shù)據(jù)信號(hào)
bcfLCD_CNTL2,E
movfByte,W;接著送低半字節(jié)
movwfLCD_DATA1
rlfLCD_DATA1,1
rlfLCD_DATA1,1
movlw0x3c
andwfLCD_DATA1,1
movfLCD_DATA1,w
movwfLCD_DATA
bsfLCD_CNTL1,RS;設(shè)置為送數(shù)據(jù)模式
bsfLCD_CNTL2,E;發(fā)送數(shù)據(jù)信號(hào)
bcfLCD_CNTL2,E
callDelay
return
;*******************************************************************
;*SendCmd-送命令到LCD*
;*本程序?qū)⒚顢?shù)據(jù)分成了高半字節(jié)和低半字節(jié)分別輸入*
;*先送入的是高半字節(jié)*
;*******************************************************************
SendCmd
bcfSTATUS,RP0
movwfByte;存WREG到Byte寄存器
swapfByte,W;送入命令的高字節(jié)
movwfLCD_DATA1
rlfLCD_DATA1,1
rlfLCD_DATA1,1
movlw0x3c
andwfLCD_DATA1,1
movfLCD_DATA1,w
movwfLCD_DATA
bcfLCD_CNTL1,RS;設(shè)置為送命令模式
bsfLCD_CNTL2,E;發(fā)送數(shù)據(jù)信號(hào)
bcfLCD_CNTL2,E
movfByte,W;接著送命令的低字節(jié)
movwfLCD_DATA1
rlfLCD_DATA1,1
rlfLCD_DATA1,1
movlw0x3c
andwfLCD_DATA1,1
movfLCD_DATA1,w
movwfLCD_DATA
bcfLCD_CNTL1,RS;設(shè)置為送命令模式
bsfLCD_CNTL2,E;發(fā)送數(shù)據(jù)信號(hào)
bcfLCD_CNTL2,E
callDelay
return
;*******************************************************************
;*Delay-延時(shí)子程序*
;*******************************************************************
Delay;call指令占用2個(gè)指令周期
bcfSTATUS,RP0
clrfCount;清Count占用1個(gè)指令周期
Dloop
decfszCount,f;這兩行指令將延時(shí)
gotoDloop;(256*3)-1個(gè)指令周期
return;return占用2個(gè)指令周期
;*******************************************************************
;*LongDelay-長(zhǎng)延時(shí)子程序*
;*******************************************************************
LongDelay
bcfSTATUS,RP0
clrfCount
clrfCount1
movlw0x03
movwfCount2
LDloop
decfszCount,f
gotoLDloop
decfszCount1,f
gotoLDloop
decfszCount2,f
gotoLDloop
return
;*------
END