
单片机英文
英语语调基本规则-秋风词古琴曲
2023年3月16日发(作者:装修报价系统)Single-chip
SCMisalsoknownasmicro-controller(Microcontroller
Unit),commonlyusedlettersoftheacronymMCUthatitwas
firstusedinindustrialcontrol.
OnlyasinglechipbytheCPUchipdevelopedfroma
stdesignisbyalargenumberof
peripheralsandCPUonachipinthecomputersystem,smaller,
moreeasilyintegratedintoacomplexanddemandingonthe
'sZ80isthefirstdesigned
inaccordancewiththisideaprocessor,thenonthedevelopment
ofmicrocontrolleranddedicatedprocessorshavepartedways.
hemost
successfulistheINTEL8031,forasimple,reliableandgood
velopedin8031outof
temsbasedonthissystemuntil
eincreasedrequirementsof
industrialcontrolfield,begana16-bitmicrocontroller,because
thecostisnotsatisfactorybuthavenotbeenverywidelyused.
After90yearswiththegreatdevelopmentofconsumer
electronics,microcontrollertechnologyhasbeenahugeincrease.
WithINTELi960series,especiallythelaterseriesofwidely
usedARM,32-bitmicrocontrollerquicklyreplacehigh-end
traditional8-bitmicrocontrollerperformancehavebeenthe
rapidincreasecapacityincreasecomparedto80thenumberof
tly,high-end32-bitmicrocontrollerclockedover
300MHz,theperformancecatchingthemid-90'sdedicated
processor,whiletheaveragemodelpricesfalltooneU.S.
dollars,themosthigh-end[1]
SCMsystemsarenolongeronlyinthedevelopmentanduseof
baremetalenvironment,alargenumberofproprietary
embeddedoperatingsystemiswidelyusedinthefullrangeof
dheldcomputersandcellphonesasthecore
processingofhigh-endmicrocontrollercanevenuseadedicated
WindowsandLinuxoperatingsystems.
SCMismoresuitablethanthespecificprocessorusedin
embeddedsystems,the
numberofSCMistheworld'human
lifeusedinalmosteverypieceofelectronicandmechanical
,telephone,
calculator,homeappliances,electronictoys,handheld
computersandcomputeraccessoriessuchasamousewitha1-2
alcomputerwillhavea
lcarwithmorethan
40SCM,complexindustrialcontrolsystemsmayevenhave
hundredsofSCMinthesametimework!SCMisnotonlyfar
exceedsthenumberofPCandothercomputingthesum,oreven
morethanthenumberofhumanbeings
Singlechip,alsoknownassingle-chipmicrocontroller,it
isnotcompleteacertainlogicchips,buttoacomputersystem
lenttoamicro-computer,and
computerthanjustthelackofamicrocontrollerI/Odevices.
Generaltalk:llsize,light
weight,cheap,forthestudy,applicationanddevelopmentof
ametime,learningtousetheMCUis
tounderstandtheprincipleandstructureofthecomputerthe
bestchoice.
SCMandthecomputerfunctionsinternallywithsimilar
modules,suchasCPU,memory,parallelbus,thesameeffectas
well,andharddiskmemorydevices,anddifferentisits
performanceofthesecomponentswererelativelyweakmanyof
ourhomecomputer,butthepriceislow,usuallynotmorethan
10yuanyoucandowithit......somecontrolforaclassisnot
sing
automaticdrumwashingmachine,smokehood,VCDandsoon
applianceswhichcouldseeitsshadow!......Itisprimarilyasa
controlsectionofthecorecomponents
Itisanonlinereal-timecontrolcomputer,control-lineis
thatthesceneisneededisastrongeranti-jammingability,low
cost,andthisis,andoff-linecomputer(suchashomePC),the
maindifference.
Singlechip
MCUisthroughrunning,h
differentprocedurestoachievedifferentfunctions,inparticular
specialuniquefeatures,thisisanotherdevicemucheffortneeds
tobedone,ry
complexfunctionsifthe50'swiththeUnitedStatesdeveloped
74series,orthe60'sCD4000seriesofthesepurehardware
buttoned,thenthecircuitmustbealargePCBboard!Butifthe
UnitedStatesifthe70'swithaseriesofsuccessfulSCMmarket,
theresultwillbeadrasticchange!Justbecauseyouareprepared
bymicrocomputerprogramscanachievehighintelligence,high
efficiencyandhighreliability!
Asthemicrocontrolleronthecost-sensitive,sonowthe
dominantsoftwareorthelowestlevelassemblylanguage,which
isthelowestlevelinadditiontomorethanbinarymachinecode
language,andassolowwhyistheuse?Manyhigh-level
languagehasreachedthelevelofvisualprogrammingWhyis
notit?Thereasonissimplythatthereisnohomecomputerasa
singlechipCPU,notashardasamassstoragedevice.A
visualizationofsmallhigh-levellanguageprogramwhicheven
ifonlyonebutton,willreachtensofKofsize!Forthehome
PC'sharddriveintermsofnothing,butintermsoftheMCUis
heutilizationofhardwareresourcesto
beveryhighforthejobsoalthoughtheoriginalisstillinthe
etoken,ifthegiant
computeroperatingsystemandapplicationsrunuptogethome
PC,homePC,alsocannotaffordto.
Canbesaidthatthetwentiethcenturyacrossthethree
"power"era,thatis,theageofelectricity,theelectronicageand
r,thiscomputer,
usuallyreferstothepersonalcomputer,
consistsofthehost,keyboard,monitorandothercomponents.
Anothertypeofcomputer,
computeristogiveallkindsofintelligentmachinessinglechip
(alsoknownasmicro-controller).Asthenamesuggests,this
computersystemtookonlyaminimalintegratedcircuit,canbe
eitissmall,usually
hiddeninthechargedmechanical"stomach"the
device,likethehumanbrainplaysarole,itgoeswrong,the
,thismicrocontrollerhasavery
broadfieldofuse,suchassmartmeters,real-timeindustrial
control,communicationsequipment,navigationsystems,and
lkindsofproductswereusing
SCM,canservetoupgradetheeffectivenessofproducts,often
intheproductnameprecededbytheadjective-"intelligent,"
etechnical
personneloffactoriesorotheramateurelectronicsdevelopersto
engageinoutofcertainproducts,notthecircuitistoo
complicated,thatfunctionistoosimpleandcaneasilybecopied.
Thereasonmaybestuckintheproductdidnotusea
microcontrollerorotherprogrammablelogicdevice.
SCMhistory
SCMwasborninthelate20thcentury,70,experienced
SCM,MCU,SOCthreestages.
Firstmodel
singlechipmicrocomputer(SingleChip
Microcomputer)stage,mainlyseekingthebestofthebestsingle
formofembeddedsystemsarchitecture."Innovationmodel"
success,layingtheSCMandgeneralcomputercompletely
penroadofindependent
developmentofembeddedsystems,IntelCorporation
contributed.
micro-controller(MicroControllerUnit)
stage,themaindirectionoftechnologydevelopment:expanding
tomeettheembeddedapplications,thetargetsystem
requirementsforthevariousperipheralcircuitsandinterface
circuits,lvesthe
areasassociatedwiththeobjectsystem,therefore,the
developmentofMCU'sresponsibilityinevitablyfallson
electrical,ispointofview,
developmentofMCU,themostfamousmanufacturersasthe
scompanyinembedded
applications,itsgreatadvantage,theMCS-51single-chip
micro-computerfromtherapiddevelopmentofthe
ore,whenwelookbackatthepathof
developmentofembeddedsystems,donotforgetInteland
PhilipsinHistory.
EmbeddedSystems
Embeddedsystemmicrocontrollerisanindependent
developmentpath,theMCUimportantfactorinthe
developmentstage,isseekingapplicationstomaximizethe
solutiononthechip;Therefore,thedevelopmentofdedicated
microelectronics,ICdesign,EDAtoolsdevelopment,
applicationsystembasedonMCUSOCdesignhavegreater
ore,theunderstandingofthe
microcontrollerchipmicrocomputercanbe,extendedtothe
single-chipmicro-controllerapplications.
MCUapplications
SCMnowpermeateallareasofourlives,whichisalmost
e
navigationequipment,aircraft,alltypesofinstrumentcontrol,
computernetworkcommunicationsanddatatransmission,
industrialautomation,real-timeprocesscontrolanddata
processing,extensiveuseofvarioussmartICcard,civilian
luxurycarsecuritysystem,videorecorder,camera,fully
automaticwashingmachinecontrol,andprogram-controlled
toys,electronicpet,etc.,whichareinseparablefromthe
entiontheareaofrobotcontrol,
intelligentinstruments,ore,the
MCUlearning,developmentandapplicationofthelargenumber
ofcomputerapplicationsandintelligentcontrolofthescientists,
idelyusedininstrumentsandmeters,
householdappliances,medicalequipment,aerospace,
specializedequipment,intelligentmanagementandprocess
controlfields,roughlydividedintothefollowingseveralareas:
pplicationofIntelligentInstruments
SCMhasasmallsize,lowpowerconsumption,controlling
function,expansionflexibility,theadvantagesofminiaturization
andeaseofuse,widelyusedinstrument,combiningdifferent
typesofsensorscanberealizedZhuruvoltage,power,frequency,
humidity,temperature,flow,speed,thickness,angle,length,
hardness,elemental,
makesuseofdigitalinstruments,intelligence,miniaturization,
andfunctionalitythanelectronicordigitalcircuitsmore
precisionmeasuringequipment(powermeter,
oscilloscope,variousanalyticalinstrument).
ndustrialcontrolapplication
WiththeMCUcanconstituteavarietyofcontrolsystems,data
factoryassemblylineofintelligent
control
eholdAppliances
canbesaidthattheappliancesarebasicallyusingSCM,praise
fromtheelectricrice,washingmachines,refrigerators,air
conditioners,colorTV,andotheraudiovideoequipment,tothe
electronicweighingequipment,varied,andomnipresent.
ieldofcomputernetworksandcommunications
applications
MCUgeneralwithmoderncommunicationinterface,canbe
easywiththecomputerdatacommunication,networkingand
communicationsincomputerapplicationsbetweendeviceshad
excellentmaterialconditions,arebasicallyallcommunication
equipmenttoachieveacontrolledbyMCUfrommobilephone,
telephone,mini-program-controlledswitchboards,building
automatedcommunicationscallsystem,trainradio
communication,tothedailyworkcanbeseeneverywhereinthe
mobilephones,trunkedmobileradio,walkie-talkies,etc..
omputerinthefieldofmedicaldevice
applications
SCMintheuseofmedicaldevicesisalsoquiteextensive,such
asmedicalrespirator,thevariousanalyzers,monitors,
ultrasounddiagnosticequipmentandhospitalbeds,
system.
ietyofmajorappliancesinthemodular
applications
Designedtoachievesomespecialsinglespecificfunctiontobe
modularinavarietyofcircuitapplications,withoutrequiring
c
integratedsinglechip,seeminglysimplefunction,miniature
electronicchipinthenet(theprincipleisdifferentfromthetape
machine),youneedacomputersimilartotheprincipleofthe
:musicsignaltodigitalformstoredinmemory
(likeROM),readbythemicrocontroller,analogmusicinto
electricalsignals(similartothesoundcard).Inlargecircuits,
modularapplicationsthatgreatlyreducethevolume,simplifies
thecircuitandreducethedamage,errorrate,butalsoeasyto
replace.
ontrollerintheapplicationfieldofautomotive
equipment
SCMinautomotiveelectronicsiswidelyused,suchasavehicle
enginecontroller,CANbus-basedIntelligentElectronicControl
Engine,GPSnavigationsystem,absanti-lockbrakingsystem,
brakesystem,etc..Inaddition,theMCUinbusiness,finance,
research,education,nationaldefense,aerospaceandotherfields
hasaverywiderangeofapplications.
Applicationofsiximportantpartoflearning
MCUlearninganimportantpartofthesixapplications
1,Bus:
Weknowthatacircuitisalwaysmadebythedevicesconnected
bywires,inanalogcircuits,theconnectiondoesnotbecomea
problembecausethedeviceisaserialrelationshipbetweenthe
general,thedeviceisnotmuchconnectionbetweenthe,butthe
computerisnotthesamecircuit,itisamicroprocessorcore,the
devicemustbeconnectedwiththemicroprocessor,thedevice
mustbecoordinationbetween,sotheyneedtoconnectonalot,
asifstillanalogcircuitlikethemicroprocessoranddevicesin
theconnectionbetweentheindividual,thenumberoflineswill
bealittlemoresurprising,thereforetheintroductionofthe
microprocessorbusZhongEachdeviceGongtongaccess
connections,alldevices8Shujulineallreceivedeightpublic
online,thatistheequivalentofalldevicestogetherinparallel,
butonlythisdoesnotwork,iftherearetwodevicessenddataat
thesametime,a0,a1,then,whetherthereceiverreceivedwhat
isit?Thissituationisnotallowed,sotobecontrolledby
controllingtheline,time-sharingthedevicetoworkatanytime
onlyonedevicetosenddata(whichcanhavemultipledevices
toreceiveboth).Device'sdataconnectionisknownasthedata
bus,thedeviceiscalledlineofcontrolallthecontrolbus.
Internal
orexternalmemoryinthemicrocontrollerandotherdevices
havememorycells,thememorycelltobeassignedaddresses,
youcanuse,distribution,ofcourse,toaddressgivenintheform
ofelectricalsignals,andasmorememorycells,so,forthe
addressallocationThelineisalsomoreoftheselinesiscalled
theaddressbus.
Second,data,address,command
Thereasonwhythesethreetogetherbecauseofthenatureof
thesethreearethesame-thenumber,orareastringof'0'and'1'
rwords,addresses,instructionsare
ction:fromsinglechipdesignerprovidesa
numberofcommonlyusedinstructionswithmnemonicwehave
astrictcorrespondencebetweenthedevelopercannotbe
s:thesearchforMCUinternal,
externalstorageunits,inputandoutputportbasedonthe
addressoftheinternalunitvalueprovidedbythechipdesigner
isgood,cannotbechanged,theexternalunitcanbesinglechip
developerstodecide,butthereareanumberofaddressunitsisa
must(seeproceduresfortheimplementationoftheprocess).
Third,P0port,P2andP3ofthesecondfunctionIuse:
BeginnersoftenontheP0port,P2andP3portIusethesecond
functionpuzzledthatthesecondfunctionandhaveaswitch
betweentheoriginalfunctionoftheprocess,orhaveadirective,
infact,theportThesecondfeatureisautomatic,donotneed
P3.6,P3.7respectivelyWR,RD
signal,whenthemicrochipprocessingmachinesexternalRAM
orexternalI/Oport,theyareusedasasecondfunction,notas
ageneral-purposeI/Oportused,solongasaAmicroprocessor
implementationoftheMOVXinstruction,therewillbea
correspondingsignalsentfromtheP3.6orP3.7,noprioruseof
'notasageneral-purposeI/Oportuse'is
alsonota'no'but(user)'not'asageneral-purposeI/Oportto
arrangetheorderofaSETBP3.7'sinstructions,
andwhentheMCUexecutiontotheinstruction,thealsomake
P3.7intoahigh,butuserswillnotdosobecausethisisusually
willcausethesystemtocollapse.
Fourth,theprogram'simplementation:
Reductioninpowerafterthe8051microcontrollerwithinthe
programcounter(PC)inthevalueof0000',theprocessis
alwaysfromthe0000'unitsstarted,thatis:thesystemmust
existinROM0000'thisunit,andin0000'unitmustbestoredin
asingleinstruction.
5,thestack:
Stackisaregion,isusedtostoredata,thereisnospecialabout
theregionitselfisapartofinternalRAM,specialaccesstoits
datastorageandthewaythattheso-called'advancedpostout
backwardfirstout',andthestackhasaspecialdatatransmission
instructionsthat'PUSH'and'POP',hasaspecialexpertiseinits
servicesunit,thatis,thestackpointerSP,wheneveraPUSH
instructionexecution,SPon(intheBasedontheoriginalvalue)
automaticallyadd1,whenevertheimplementationofaPOP
instruction,SPwill(onthebasisoftheoriginalvalue)
Pvaluescanbechangedwiththe
instructions,solongasthebeginningoftheprocesstochange
thevalueoftheSP,youcansetthestackmemoryunitrequired,
suchastheprogrambegins,withanMOVSP,#5FH
instructionsWhensetonthestackstartingfromthememory
salwaysthebeginningofthegeneral
procedurewithsuchadirectivetosetthestackpointer,because
boot,SPinitialvalueof07H,08HThisunitfromthebeginning
tostacknext,and08Hto1FH8031isthesecondintheregion,
threeorfourworkingregisterarea,oftenused,thiswillleadto
entauthorswhenwritingprograms,
initializethestackisnotexactlythesamedirective,whichisthe
author'shabit.
Whensetupthestackzone,doesnotmeanthattheregion
becomeaspecialmemory,itcanstillusethesamememory
regionasnormal,butgenerallytheprogrammerdoesnotregard
itasanordinarymemoryused.
单片机
单片机也被称为微控制器MicrocontrollerUnit常
用英文字母的缩写MCU表示单片机它最早是被用在工业控
制领域。单片机由芯片内仅有CPU的专用处理器发展而来。
最早的设计理念是通过将大量外围设备和CPU集成在一个
芯片中使计算机系统更小更容易集成进复杂的而对体
积要求严格的控制设备当中。INTEL的Z80是最早按照这种
思想设计出的处理器从此以后单片机和专用处理器的
发展便分道扬镳。
早期的单片机都是8位或4位的。其中最成功的是
INTEL的8031因为简单可靠而性能不错获得了很大的好
评。此后在8031上发展出了MCS51系列单片机系统。基于
这一系统的单片机系统直到现在还在广泛使用。随着工业控
制领域要求的提高开始出现了16位单片机但因为性价
比不理想并未得到很广泛的应用。90年代后随着消费电子产
品大发展单片机技术得到了巨大提高。随着INTELi960系列
特别是后来的ARM系列的广泛应用32位单片机迅速取代
16位单片机的高端地位并且进入主流市场。而传统的8位
单片机的性能也得到了飞速提高处理能力比起80年代提
高了数百倍。目前高端的32位单片机主频已经超过
300MHz性能直追90年代中期的专用处理器而普通的型
号出厂价格跌落至1美元最高端[1]的型号也只有10美元。
当代单片机系统已经不再只在裸机环境下开发和使用大量
专用的嵌入式操作系统被广泛应用在全系列的单片机上。而
在作为掌上电脑和手机核心处理的高端单片机甚至可以直
接使用专用的Windows和Linux操作系统。
单片机比专用处理器更适合应用于嵌入式系统因此
它得到了最多的应用。事实上单片机是世界上数量最多的计
算机。现代人类生活中所用的几乎每件电子和机械产品中都
会集成有单片机。手机、电话、计算器、家用电器、电子玩
具、掌上电脑以及鼠标等电脑配件中都配有1-2部单片机。
而个人电脑中也会有为数不少的单片机在工作。汽车上一般
配备40多部单片机复杂的工业控制系统上甚至可能有数
百台单片机在同时工作单片机的数量不仅远超过PC机和
其他计算的总和甚至比人类的数量还要多。
单片机又称单片微控制器,它不是完成某一个逻辑功能
的芯片,而是把一个计算机系统集成到一个芯片上。相当于一
个微型的计算机和计算机相比单片机只缺少了I/O设
备。概括的讲一块芯片就成了一台计算机。它的体积小、
质量轻、价格便宜、为学习、应用和开发提供了便利条件。
同时学习使用单片机是了解计算机原理与结构的最佳选择。
单片机内部也用和电脑功能类似的模块比如CPU
内存并行总线还有和硬盘作用相同的存储器件不同的
是它的这些部件性能都相对我们的家用电脑弱很多不过
价钱也是低的一般不超过10元即可......用它来做一些控制
电器一类不是很复杂的工作足矣了。我们现在用的全自动滚
筒洗衣机、排烟罩、VCD等等的家电里面都可以看到它的身
影......它主要是作为控制部分的核心部件。
它是一种在线式实时控制计算机在线式就是现场控
制需要的是有较强的抗干扰能力较低的成本这也是
和离线式计算机的比如家用PC的主要区别。
单片机芯片
单片机是靠程序运行的并且可以修改。通过不同的程
序实现不同的功能尤其是特殊的独特的一些功能这是
别的器件需要费很大力气才能做到的有些则是花大力气
也很难做到的。一个不是很复杂的功能要是用美国50年代
开发的74系列或者60年代的CD4000系列这些纯硬件来
搞定的话电路一定是一块大PCB板但是如果要是用美
国70年代成功投放市场的系列单片机结果就会有天壤之
别只因为单片机的通过你编写的程序可以实现高智能
高效率以及高可靠性!
由于单片机对成本是敏感的所以目前占统治地位的
软件还是最低级汇编语言它是除了二进制机器码以上最
低级的语言了既然这么低级为什么还要用呢很多高级
的语言已经达到了可视化编程的水平为什么不用呢?原因很
简单,就是单片机没有家用计算机那样的CPU,也没有像硬盘
那样的海量存储设备。一个可视化高级语言编写的小程序里
面即使只有一个按钮,也会达到几十K的尺寸。对于家用PC
的硬盘来讲没什么,可是对于单片机来讲是不能接受的。单
片机在硬件资源方面的利用率必须很高才行,所以汇编虽然
原始却还是在大量使用。一样的道理,如果把巨型计算机上
的操作系统和应用软件拿到家用PC上来运行,家用PC的也
是承受不了的。
可以说,二十世纪跨越了三个“电”的时代,即电气时
代、电子时代和现已进入的电脑时代。不过,这种电脑,通
常是指个人计算机,简称PC机。它由主机、键盘、显示器
等组成。还有一类计算机,大多数人却不怎么熟悉。这种计
算机就是把智能赋予各种机械的单片机,亦称微控制器。
顾名思义,这种计算机的最小系统只用了一片集成电路,即
可进行简单运算和控制。因为它体积小,通常都藏在被控机
械的“肚子”里。它在整个装置中,起着有如人类头脑的作
用。它出了毛病,整个装置就瘫痪了。现在,这种单片机的
使用领域已十分广泛,如智能仪表、实时工控、通讯设备、
导航系统、家用电器等。各种产品一旦用上了单片机,就能
起到使产品升级换代的功效,常在产品名称前冠以形容词—
—“智能型”。如智能型洗衣机等。现在有些工厂的技术人
员或其它业余电子开发者搞出来的某些产品。不是电路太复
杂,就是功能太简单且极易被仿制。究其原因,可能就卡在
产品未使用单片机或其它可编程逻辑器件上。
单片机历史
单片机诞生于20世纪70年代末,经历了SCM、MCU、
SoC三大阶段。
起初模型
即单片微型计算机(SingleChipMicrocomputer)
阶段,主要是寻求最佳的单片形态嵌入式系统的最佳体系结
构。“创新模式”获得成功,奠定了SCM与通用计算机完全
不同的发展道路。在开创嵌入式系统独立发展道路上,Intel
公司功不可没。
即微控制器(MicroControllerUnit)阶段,主要
的技术发展方向是:不断扩展满足嵌入式应用时,对象系统
要求的各种外围电路与接口电路,突显其对象的智能化控制
能力。它所涉及的领域都与对象系统相关,因此,发展MCU
的重任不可避免地落在电气、电子技术厂家。从这一角度来
看,Intel逐渐淡出MCU的发展也有其客观因素。在发展
MCU方面,最著名的厂家当数Philips公司。
Philips公司以其在嵌入式应用方面的巨大优势,将
MCS-51从单片微型计算机迅速发展到微控制器。因此,当
我们回顾嵌入式系统发展道路时,不要忘记Intel和Philips
的历史功绩。
嵌入式系统
单片机是嵌入式系统的独立发展之路,向MCU阶段
发展的重要因素,就是寻求应用系统在芯片上的最大化解
决,因此,专用单片机的发展自然形成了SOC化趋势。随着
微电子技术、IC设计、EDA工具的发展,基于SOC的单片
机应用系统设计会有较大的发展。因此,对单片机的理解可
以从单片微型计算机、单片微控制器延伸到单片应用系统。
单片机的应用领域
目前单片机渗透到我们生活的各个领域,几乎很难找到
哪个领域没有单片机的踪迹。导弹的导航装置,飞机上各种
仪表的控制,计算机的网络通讯与数据传输,工业自动化过
程的实时控制和数据处理,广泛使用的各种智能IC卡,民
用豪华轿车的安全保障系统,录像机、摄像机、全自动洗衣
机的控制,以及程控玩具、电子宠物等等,这些都离不开单
片机。更不用说自动控制领域的机器人、智能仪表、医疗器
械了。因此,单片机的学习、开发与应用将造就一批计算机
应用与智能化控制的科学家、工程师。
单片机广泛应用于仪器仪表、家用电器、医用设备、航
空航天、专用设备的智能化管理及过程控制等领域大致可
分如下几个范畴:
1.在智能仪器仪表上的应用
单片机具有体积小、功耗低、控制功能强、扩展灵活、
微型化和使用方便等优点广泛应用于仪器仪表中,结合不
同类型的传感器,可实现诸如电压、功率、频率、湿度、温
度、流量、速度、厚度、角度、长度、硬度、元素、压力等
物理量的测量。采用单片机控制使得仪器仪表数字化、智
能化、微型化,且功能比起采用电子或数字电路更加强大。
例如精密的测量设备(功率计,示波器,各种分析仪)。
2.在工业控制中的应用
用单片机可以构成形式多样的控制系统、数据采集系
统。例如工厂流水线的智能化管。
3.在家用电器中的应用
可以这样说,现在的家用电器基本上都采用了单片机控
制,从电饭褒、洗衣机、电冰箱、空调机、彩电、其他音响
视频器材、再到电子秤量设备,五花八门,无所不在。
4.在计算机网络和通信领域中的应用
现代的单片机普遍具备通信接口,可以很方便地与计算
机进行数据通信,为在计算机网络和通信设备间的应用提供
了极好的物质条件,现在的通信设备基本上都实现了单片机
智能控制,从手机,电话机、小型程控交换机、楼宇自动通
信呼叫系统、列车无线通信、再到日常工作中随处可见的移
动电话,集群移动通信,无线电对讲机等。
5.单片机在医用设备领域中的应用
单片机在医用设备中的用途亦相当广泛。例如医用呼吸
机,各种分析仪,监护仪超声诊断设备及病床呼叫系统等
等。
6.在各种大型电器中的模块化应用
某些专用单片机设计用于实现特定功能,从而在各种电
路中进行模块化应用,而不要求使用人员了解其内部结构。
如音乐集成单片机,看似简单的功能,微缩在纯电子芯片中
有别于磁带机的原理,就需要复杂的类似于计算机的原理。
如音乐信号以数字的形式存于存储器中,类似于ROM,由
微控制器读出,转化为模拟音乐电信号,类似于声卡。
在大型电路中,这种模块化应用极大地缩小了体积,简
化了电路,降低了损坏、错误率,也方便于更换。
7.单片机在汽车设备领域中的应用
单片机在汽车电子中的应用非常广泛,例如汽车中
的发动机控制器,基于CAN总线的汽车发动机智能电子控
制器,GPS导航系统,abs防抱死系统,制动系统等等。
此外,单片机在工商,金融,科研、教育,国防航
空航天等领域都有着十分广泛的用途。
学习应用六大重要部分
单片机学习应用的六大重要部分
一、总线
我们知道,一个电路总是由元器件通过电线连接而成
的,在模拟电路中,连线并不成为一个问题,因为各器件间
一般是串行关系,各器件之间的连线并不很多,但计算机电
路却不一样,它是以微处理器为核心,各器件都要与微处理
器相连,各器件之间的工作必须相互协调,所以需要的连线
就很多了,如果仍如同模拟电路一样,在各微处理器和各器
件间单独连线,则线的数量将多得惊人,所以在微处理机中
引入了总线的概念,各个器件共同享用连线,所有器件的8
根数据线全部接到8根公用的线上,即相当于各个器件并联
起来,但仅这样还不行,如果有两个器件同时送出数据,一
个为0,一个为1,那么,接收方接收到的究竟是什么呢,
这种情况是不允许的,所以要通过控制线进行控制,使器件
分时工作,任何时候只能有一个器件发送数据,可以有多个
器件同时接收。器件的数据线也就被称为数据总线,器件
所有的控制线被称为控制总线。在单片机内部或者外部存储
器及其它器件中有存储单元,这些存储单元要被分配地址,
才能使用,分配地址当然也是以电信号的形式给出的由于
存储单元比较多,所以,用于地址分配的线也较多,这些线
被称为地址总线。
二、数据、地址、指令
之所以将这三者放在一起,是因为这三者的本质都是
一样的——数字,或者说都是一串‘0’和‘1’组成的序列。
换言之,地址、指令也都是数据。指令,由单片机芯片的设
计者规定的一种数字,它与我们常用的指令助记符有着严格
的一一对应关系,不可以由单片机的开发者更改。地址,是
寻找单片机内部、外部的存储单元、输入输出口的依据,内
部单元的地址值已由芯片设计者规定好,不可更改,外部的
单元可以由单片机开发者自行决定,但有一些地址单元是一
定要有的,详见程序的执行过程。
三、P0口、P2口和P3的第二功能用法
初学时往往对P0口、P2口和P3口的第二功能用法迷惑
不解,认为第二功能和原功能之间要有一个切换的过程,或
者说要有一条指令,事实上,各端口的第二功能完全是自动
的,不需要用指令来转换。如P3.6、P3.7分别是WR、RD
信号,当微片理机外接RAM或有外部I/O口时,它们被用
作第二功能,不能作为通用I/O口使用,只要一微处理机一
执行到MOVX指令,就会有相应的信号从P3.6或P3.7送出,
不需要事先用指令说明。事实上不能作为通用I/O口使用’
也并不是‘不能’而是,使用者‘不会’将其作为通用I/O
口使用。你完全可以在指令中按排一条SETBP3.7的指令,
并且当单片机执行到这条指令时也会使P3.7变为高电平,但
使用者不会这么去做,因为这通常会导致系统的崩溃。
四、程序的执行过程
单片机在通电复位后8051内的程序计数器(PC)中的
值为‘0000’,所以程序总是从‘0000’单元开始执行,也
就是说,在系统的ROM中一定要存在‘0000’这个单元,
并且在‘0000’单元中存放的一定是一条指令。
五、堆栈
堆栈是一个区域,是用来存放数据的,这个区域本身
没有任何特殊之处,就是内部RAM的一部份,特殊的是它
存放和取用数据的方式,即所谓的‘先进后出后进先出’
并且堆栈有特殊的数据传输指令,即‘PUSH’和‘POP’,
有一个特殊的专为其服务的单元,即堆栈指针SP,每当执一
次PUSH指令时,SP就在原来值的基础上自动加1,每当执
行一次POP指令,SP就在原来值的基础上自动减1。由于
SP中的值可以用指令加以改变,所以只要在程序开始阶段更
改了SP的值,就可以把堆栈设置在规定的内存单元中,如
在程序开始时,用一条MOVSP,#5FH指令,就时把堆栈设
置在从内存单元60H开始的单元中。一般程序的开头总有这
么一条设置堆栈指针的指令,因为开机时,SP的初始值为
07H,这样就使堆栈从08H单元开始往后,而08H到1FH
这个区域正是8031的第二、三、四工作寄存器区,经常要
被使用,这会造成数据的混乱。不同作者编写程序时,初始
化堆栈指令也不完全相同,这是作者的习惯问题。当设置好
堆栈区后,并不意味着该区域成为一种专用内存,它还是可
以象普通内存区域一样使用,只是一般情况下编程者不会把
它当成普通内存用了。