:2004-05:(1980),,,:PIC16F877,,(,230027):PIC,,,,:;PIC16F877;A/D:TH82:B:1006-2394(2004)05-0048-02Range2measurementInfraredSystemBasedonPIC16F877SONGYi2qun,DUHua2sheng,DONGEr2bao(UniversityofScienceandTechnologyofChina,Hefei230027,China)Abstract:Thisarticleintroducesakindofrange2measurementsysteminmobilerobotbasedonPICmicrocontrollerandinfraredsensor.Itpre2sentsthehardwareconfiguration,theelectriccircuitdesignandthesoftwaredesign.Itisprovedbyexperimentthatthesystemworksstablyandreli2ably.Keywords:infraredsensor;PIC16F877;A/Dconverter,,,PIC16F877810A/D,1,;,2PIC16F877PIC16F877Microchip8,RISC(),,,8,CISC8,21,4P1C16F8778KFlash,368byte,256byteEEPROM,3/,23CCP,,10A/D,403PIC16F8773.1TLN205,,TPS708,TPS708LM358,03V,PIC16F877RA0,18420045©1995-2006TsinghuaTongfangOpticalDiscCo.,Ltd.Allrightsreserved.A/D,,74LS138LED1,Vin(),22PIC3.2A/D3434A/D3.2.1/PIC16F877D8,ARA0D/TRISD(88h)0;ATRISA(85h)01PIC:bankelTRISD;clrfTRISD;DbsfTRISA,0;RA03.2.2A/DPIC16F877A/DA/DCON1(9fH)A/DCON0(1fH)A/D:bankselADCON1;A/DCON1movlwB00001110;movwfADCON1;RA0bankselADCON0;A/DCON0movlwB10000001;movwfADCON0;A/DA/DCON02,1,0A/DA/DRESHA/DRESL,:ADTransferbankselADCON0bsfADCON0,GO;ADWaitbtfscADCON0,GO;gotoADwait;,movfADRESH,W;Wreturn4,,5,,matlabpolyfit,025cm,,5:[1],.PIC16F87X[M].,2002.()9420045©1995-2006TsinghuaTongfangOpticalDiscCo.,Ltd.Allrightsreserved.