Académique Documents
Professionnel Documents
Culture Documents
8051Family Intelfabricatedtheoriginal8051whichisknownasMCS51.Theothertwomembersofthe8051 familyare: i. 8052Thismicrocontrollerhas256bytesofRAMand3timers.Inadditiontothe standardfeaturesof8051,thismicrocontrollerhasanadded128bytesofRAMandtimer.Ithas 8KbytesofonchipprogramROM.Theprogramswrittenforprojectsusing8051microcontroller canbeusedtorunontheprojectsusing8052microcontrolleras8051isasubsetof8052. ii. 8031Thismicrocontrollerhasallthefeaturesof8051exceptforittobeROMless.An externalROMthatcanbeaslargeas64Kbytesshouldbeprogrammedandaddedtothischip forexecution.ThedisadvantageofaddingexternalROMisthat2ports(outofthe4ports)are used.Hence,only2portsareleftforI/Ooperationswhichcanalsobeaddedexternallyif requiredforexecution.
Comparisonof8051familymembers: Features RAM(bytes) ROM Timers Serialport I/Opins Interruptsources 8051 128 4K 2 1 32 6 8052 256 8K 3 1 32 8 8031 128 0K 2 1 32 6
Table1.1Comparisonof8051familymembers Various8051microcontrollers 8051microcontrollersusetwodifferentkindsofmemorysuchasUVEPROM,Flashand NVRAM.Hence8051willnotbeseeninthepartnumbereventhoughitisthemostpopular memberofthe8051family. i.8751ThismicrocontrolleristheUVEPROMversionof8051.Thischiphas only4KbytesofUVEPROM.ItisrequiredtohaveaccesstothePROMburnerandthe UVEPROMerasertoerasethecontentsinsidethechipbeforeitisprogrammedagain.The disadvantageofusingthismemoryisthewaitingtimeofaround20minutestoerasethe contentsinordertoprogramitagain.Duetothislimitation,manufacturersfabricatedflashand NVRAMversionsof8051. ii.AT89C51fromAtmelCorporationAtmelfabricatedtheflashROMversionof 8051whichispopularlyknownasAT89C51(CinthepartnumberindicatesCMOS).Theflash memorycanerasethecontentswithinsecondswhichisbestforfastgrowth.Therefore,8751is replacedbyAT89C51toeradicatethewaitingtimerequiredtoerasethecontentsandhence expeditethedevelopmenttime.TobuildupamicrocontrollerbasedsystemusingAT89C51,itis essentialtohaveROMburnerthatsupportsflashmemory.NotethatinFlashmemory,entire contentsmustbeerasedtoprogramitagain.ThecontentsareerasedbytheROMburner. AtmelisworkingonanewerversionofAT89C51thatcanbeprogrammedusingtheserialCOM portofIBMPCinordertogetridoftheROMburner. Part Number AT89C51 AT89C52 AT89C105 ROM 4K 8K 1K RAM 128 256 64 I/Opins 32 32 15 Timer 2 3 1 Interrupt 6 8 3 Vcc 5V 5V 3V Packaging 40 40 20
Table1.2Versionsof8951fromAtmel(AllROMFlash) Therearedifferentversionsofpackagingandvariousspeedoftheproductsmentionedinthe abovetable. PartNumber Speed Pins 40 40 40 Packaging DIPPlastic DIPPlastic DIPPlastic Use Commercial Commercial Commercial
Table1.3VariousSpeedsof8051fromAtmel Note:ThepartnumberAT89C5116PCwhereATAtmel,CCMOS(consumesless power),12Speedas12MHz,PPlasticDIPpackaging,CCommercialuse. AT89C5112PCisfavourablyusedbystudentsfortheirprojects. iii.DS5000fromDallasSemiconductorDallasSemiconductorfabricatedtheNVRAM versionofthe8051whichisknownasDS5000.ThePCserialportisutilizedtoloadtheprogram ontotheinbuiltROM.TheadvantageofNVRAMmemoryisthefacilitytoerasethecontents onebyteatatime. v. Part Number DS50008 DS50003 2 DS5000T 8 DS5000T 8 RAM 128 128 128 128 ROM 8K 32K 8K 32K Timers 2 2 2 2 I/O pins 32 32 32 32 Interrupts 6 6 6 6 Vcc 5V 5V 5V 5V Packaging 40 40 40 40
Table1.4Versionsof8051fromDallasSemiconductor
ThevarietyrangeofspeedandpackagingversionsofDS5000whichisshownintheTable1.5 PartNumber DS500088 DS5000812 DS5000328 DS50003212 DS5000T812 DS5000T328 NVRAM 8K 8K 32K 32K 8K 32K Speed 8MHz 12MHz 8MHz 12MHz 12MHz 8MHz
Featuresof8051
Themainfeaturesof8051microcontrollerare: i.RAM128Bytes(Datamemory) ii.ROM4Kbytes(ROMsignifytheonchipprogramspace) iii.SerialPortUsingUARTmakesitsimplertointerfaceforserialcommunication. iv.Two16bitTimer/Counter v.Input/outputPins4Portsof8bitseachonasinglechip. vi.6InterruptSources vii.8bitALU(ArithmeticLogicUnit) viii.HarvardMemoryArchitectureIthas16bitAddressbus(eachofRAMandROM)and8bit DataBus. ix.8051canexecute1milliononecycleinstructionspersecondwitha clockfrequencyof12MHz.ThismicrocontrollerisalsocalledasSystemonachipbecauseit hasallthefeaturesonasinglechip.TheBlockDiagramof8051Microcontrollerisasshownin Figure1.1
Figure1.1BlockDiagramof8051Microcontroller
Historyof8051andKeyDevelopments IntelCorporationfabricatedthe8bitmicrocontrollerwhichwasreferredasMCS51in1981. Thismicrocontrollerwasalsoreferredassystemonachipbecauseithas128bytesofRAM, 4KbytesofROM,2Timers,1Serialport,andfourportsonasinglechip.TheCPUcanworkfor only8bitsofdataatatimebecause8051isan8bitprocessor.Incasethedataislargerthan8 bitsthenithastobebrokenintopartssothattheCPUcanprocessconveniently.Most manufacturershaveput4KbytesofROMeventhoughthequantityofROMcanbeexceededup to64Kbytes. Intelpermittedothermanufacturerstofabricatedifferentversionsof8051butwiththelimitation thatcodecompatibilityshouldbemaintained.Thishasaddedadvantagethatiftheprogramis writtenthenitcanbeusedforanyversionof8051despiteofmanufacturer. Asyearspassedby,thequalityoftechnologysurpassedtheexpectationofthegreatestminds, withgadgetsbecomingsmaller,sleekerandmoreefficient.Microcontrollerswereseenasthe answertotherequirementsraisedinadvancedelectronics.Thisisthereasonwhy manufacturershavenowfocusedtheirproductionaroundthefollowingmaindevelopmental aspects: i.Easeofuse ii.Marketavailability iii.Lesspowerusage iv.Smallerprocessingpower v.MoreintegratedfeatureslikeRFandUSB vi.Smallerformfactors
Applications The8051hasbeeninuseinawidenumberofdevices,mainlybecauseitiseasytointegrate intoaprojectorbuildadevicearound.Thefollowingarethemainareasoffocus: i.EnergyManagement:Efficientmeteringsystemshelpincontrollingenergyusageinhomesand industrialapplications.Thesemeteringsystemsaremadecapablebyincorporating microcontrollers. ii.Touchscreens:Ahighnumberofmicrocontrollerprovidersincorporatetouchsensing capabilitiesintheirdesigns.Portableelectronicssuchascellphones,mediaplayersandgaming devicesareexamplesofmicrocontrollerbasedtouchscreens. iii.Automobiles:The8051findswideacceptanceinprovidingautomobilesolutions.Theyare widelyusedinhybridvehiclestomanageenginevariants.Additionally,functionssuchascruise controlandantibrakesystemhavebeenmademoreefficientwiththeuseofmicrocontrollers. iv.MedicalDevices:Portablemedicaldevicessuchasbloodpressureandglucosemonitors
usemicrocontrollerswilltodisplaydata,thusprovidinghigherreliabilityinprovidingmedical results. Programmingenvironmentandprogrammer Formerly,programmersusedmachinelanguageforcoding.Amachinelanguageisaprogram thatconsistsof0sand1swhichwasverydrearyforthehumanstoprogramanycomputer.In duecourseoftime,assemblylanguagewasdevelopedinordertospeeduptheprogramming andmakeiterrorfree.Assemblylanguageisalowlevellanguagewhichusesanassemblerto translatetheprogramintomachinecode.Thehighlevelprogramminglanguagessuchas BASIC,Pascal,Forth,C,C++,andJavaareavailabletocodetheprogramfor8051.Thesehigh levellanguagesmakeuseofaCompilertotranslateintomachinecode.Forexample,whena programiswritteninC,theprogramneedstobetranslatedintomachinelanguageusingC compiler.Usually,AssemblyandClanguageiswidelyusedfor8051programsascomparedto theotherhighlevellanguages. The8051providesatotaloffourportsforI/Ooperations.8051has40pins,ofwhich32pinsare setasideforthefourports.PO,P1,P2,andP3eachhave8pinsandcanbeusedforeither inputoroutput.TheremainingpinsaredesignatedasVrt,GND,XTAL1,XTAL2,RST,EA, ALE/PROGandPSEN. 8051allowsyoutomanipulateoneorallofthebitsofaport,thusprovidingprogrammerswitha uniqueandpowerfulfeature.8051providestheprogrammerwiththeabilitytoread,writeand modifyeachporttocustomizeapplicationsasmuchaspossible.
AT89C51 Microcontroller
PinDiagram:
Pin No 1 2 3 4 5 6 7 8 9 10
Function 8bitinput/outputport(P1)pins
Reset 8bit P3.0 input/output port(P3) pins P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 Crystal2 Crystal1
11 12 13 14 15 16 17 18 19 20 21
Ground P2.0/A8
22 23 24 25 26 27 28 29 30 ProgramstoreenableReadfromexternal programmemory AddressLatchEnable ProgrampulseinputduringFlashprogramming 31 ExternalAccessEnableVccforinternal programexecutions Programmingenablevoltage12V(duringFlash programming) 32 8bitinput/outputport(P0)pins Loworderaddressbitswheninterfacingwith externalmemory 33 34 35 36 37 38 39 40 Supplyvoltage5V(upto6.6V)
P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P2.5/A13 P2.6/A14 P2.7/A15 PSEN ALE Prog EA Vpp P0.7/AD7