286Vol.28No.6201012JournalofKailiUniversityDec.2010ARM*王正万1,2(1.,550025;2.,556000):基于ARM的嵌入式技术应用越来越广泛,本文研究的是基于ARM的自动寻迹小车,通过反射式光电传感器来检测黑线,并把信号传给微控制器,进入相关控制程序,控制电机的转向来寻迹,终点时,同时检测到黑线停止,是机器人控制技术必须解决的问题之一,通过实验,和其它控制方法相比,本文的设计与实现的方法更简单.:AdvancedRISCMachines;寻迹小车;反射式光电传感器;步进电机;C语言:Doi:10.3969/j.issn.16739329.2010.06.1311.1,,,,.,;,.,,.1.21000,30,64kB2GB,0.1~2000MIPS.4:CU(MicroControllerUnit),ARM;MPU(MicroProcessorUnit);DSP(DigitalSignalProcessor);(SOC)[1].ARMAdvancedRISCMachines,,,8ARM,ARMDSP.DSP,.ARM91.1MIPS/MHz,233MHz.ARM10700MHz.DSP.ARM.1.3ARM,,.,5V,12V,Easy21313V5VUSB.,,.,,,,,,..,,,.23.,,,,.1.40*:20100608:(1978),,,,,.1CPARM2131PWM;42BYG,,12V;ARM21313V5V;ST188ST198,.,,,.5V5:ARM2131,;81300mA10.42V,12V0.5A,[2].33.1ARM21312.P0.16ZuoZhuan,;P0.20YuoZhuan,.:,ARM2131SM202A.23.2SM202A:K1K2K3.,..:CP,CP,,.3.342BYG..,.;,,..,,.,...,,.3.4:,,.,.,3.:,,,R2,;,,,,,R2,,.,,,.[3].344.1,,:10;PWM2,CP;,,,,IRQ.,,4.,414.,;,,5[4].,.,,,,.4.2(1)PWM2voidPWM2_Init(){PWMPR=0x00;//,PWMFpclkPWMMCR=0x02;//PWMMR0PWMTCPWMTCPWMPCR=(10)|//PWM2(110);//PWM2PWMMR0=Fpclk/400;//PWM/,T=1/400s,//,PWMMR2=PWMMR0/2;//PWM1,STK_CLKPWMLER=0x05;5//0,2PWMPWMTCR=0x02;//PWMTCPWMTCR=0x09;//PWM}voidTimer0_Init(void){T0TC=0;//0T0PR=0;//T0MCR=0x03;//T0MR0T0TC,T0MR0=Fpclk/10;//1/10s,//,T0TCR=0x01;//0T0IR=0x01;//}(2)voidmotor_left_forward(uint8speed){motol_uen1;motol_en2;if(speed!=0)//{OCR0=speed;}T0_EN;}//voidmotor_left_backward(uint8speed)42{motol_en1;motol_uen2;if(speed!=0)//{OCR0=speed;}T0_EN;}//voidmotor_left_speed_set(uint8speed){if(speed!=0){OCR0=speed;}}//voidmotor_left_stop(void){motol_uen1;motol_uen2;T0_UEN;}//voidmotor_left_quick_stop(void){motol_en1;motol_en2;T0_UEN;},,[5].:[1].[M].:,2007.[2].ARM7LPC213x/214x[M].:,2009.[3].ARM[M].:,2008.[4].[M].:,2006.[5].[M].:,2005.[:]DesignandImplementationofCarAutoTracingofARMbasedWANGZhengwan(1.SchoolofProfessionTechnique,GuizhouUniversity,Guiyang,Guizhou550025,China;2.CollegeofElectronInformationProfessionTechniqueinGuizhou,Guiyang,Guizhou556000,China)Abstract:ARMbasedembeddedtechnologymorewidely,thisstudyisbasedontheARMcarautotracingthroughthereflectivephotoelectricsensortodetecttheblackline,andthesignalstothemicrocontroller,entertherelevantcontrolprocedures,controlmotorTheshiftfromeitherthetrackandfinishatthesametimedetectblacklinestop,arobotcontroloneoftheproblemsmustbesolvedbyexperiment,andothercontrolmethods,thedesignandimplementationofthismethodismoresimple.Keywords:AdvancedRISCMachines;cartracing;reflectivephotoelectricsensor;steppermotor;Clanguage43