B876214单片机Word文档下载推荐.docx
《B876214单片机Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《B876214单片机Word文档下载推荐.docx(9页珍藏版)》请在冰豆网上搜索。
May1,2011
Assessor/Tutor:
SunnyYao
InternalVerifier:
RickyZhang
Student:
JianfengWu
Student’sReg.No:
B876214
NOTESTOSTUDENTS
●Checkcarefullythesubmissiondateandtheinstructionsgivenwiththeassignment.Lateassignmentswillnotbeaccepted.
●Ensurethatyougiveyourselfenoughtimetocompletetheassignmentbytheduedate.
●Donotleavethingssuchasprintingtothelastminute–excusesofthisnaturewillnotbeacceptedforfailuretohand-intheworkontime.
●Youmusttakeresponsibilityformanagingyourowntimeeffectively.
●Ifyouareunabletohandinyourassignmentontimeandhavevalidreasonssuchasillness,youmayapply(inwriting)foranextension.
●Whenyourefertotheworkofotherauthorsinyourassignment,youmustpracticecitationbyfollowingHarvardSystemforReferencing.
●Ifyouarecaughtplagiarizing,youcouldhaveyourgradereducedtozero,oratworst,youcouldbeexcludedfromthecourse.
STUDENT’SDECLARATION:
Iconfirmthatthisisallmyownwork.
Student’sSignature:
JianfengWu
ASSESSMENTforPart1
Grade
Criteria/
Descriptors
Evidence
Feedback
Assess
PassAssessment
2.Producesoftwareforamicroprocessor-basedsystem
2.1Designsoftwaretoagivenspecificationusingastructureddesigntechnique
※Analgorithmblockflowdiagramispresented.
2.2Writeprogramstoimplementdesignsusinganappropriatecomputerlanguage
※Anexecutableprogramthatmeetsthebasicrequirementsisedited.
2.3Testsoftwaretoensureitmeetsthegivenspecification
※Runningresultmeetsthegivenspecification
GradingAssessment
M1identifyandapplystrategiestofindappropriatesolutions
Aneffectiveapproachtostudyandresearchhasbeenapplied
※Canuseproperapplicationsoftwarecorrectly.
M2selectandapplyappropriatemethods/techniques
Thedesignofmethods/techniqueshasbeenjustified
※Astructureddesigntechniqueisusedverywell.
M3presentandcommunicateappropriatefindings
Thecommunicationisappropriateforfamiliarand
unfamiliaraudiencesandappropriatemediahavebeenused
※Makealectureforyourapplicationdesigninclassthroughmediaandhavedoneitveryclearly.
D1usecriticalreflectiontoevaluateownworkandjustifyvalidconclusions
Thevalidityofresultshasbeenevaluatedusingdefinedcriteriaandselfcriticismofapproachhastakenplace
※Theresulthasmetrequirementgivenandthereisevaluationinyourassignmentthatexplainsprogram’sadvantagesanddisadvantages.
D2takeresponsibilityformanagingandorganizingactivities
Theimportanceofinterdependencehasbeenrecognizedand
achieved
※Doyourassignmentwithoutotherperson'
shelp.
D3demonstrateconvergent/lateral/creativethinking
Innovationandcreativethoughthavebeenapplied
※Proposedacreativethinkinginyourassignment.
Assessor’sadditionalcomments
Assessor’ssignature:
Student’sFeedback
Student’ssignature:
Notes:
AssignmentDescription
Scenario
RecentlyAtmelCompanyhassuccessfullydevelopedanewmorepowerfulmicrocontroller(AT89S51).TheAT89S51isalow-power,high-performanceCMOS8-bitmicrocontrollerwith4KbytesofIn-systemProgrammableFlashmemory.ThedeviceismanufacturedusingAtmel’shigh-densitynonvolatilememorytechnologyandiscompatiblewiththeindustry-standard80C51instructionsetandpinout.Theon-chipFlashallowstheprogrammemorytobereprogrammedin-systemorbyaconventionalnonvolatilememoryprogrammer.Bycombiningaversatile8-bitCPUwithIn-SystemProgrammableFlashonamonolithicchip,theAtmelAT89S51isapowerfulmicrocontrollerwhichprovidesahighly-flexibleandcost-effectivesolutiontomanyembeddedcontrolapplications.Inordertoincreasethenewproductmarketpromotion,thecompanydecidestoorganizeanewsconferenceforit.Youareassignedtodesignanadvertisingdemosystemtodisplaytheconvenientandpowerfulapplicationdevelopmentfunctionofthisnewproduct.Thesystemyoudesignmustbeabletodemonstrateatleasttwoapplicationsbasedonthistypeofmicrocontroller.
Part1(ThispartmustbeaccomplishedbeforeMay1,2011):
Directlyusetheinput/outputportsofthismicrocontrollertodoanapplicationsystem.Pleaseprovideyourdesignreportswhichmustcontainthefollowingpoints:
Task:
1.(PassCriterion2.1)Designsoftwaretoagivenspecificationusingastructureddesigntechnique.Designanalgorithmblockflowdiagramusingastructureddesigntechniqueforyourdevelopment.
2.(PassCriterion2.2)Writeprogramstoimplementdesignsusinganappropriatecomputerlanguage.Pleasewritetheprograminassemblerorclanguageaccordingtothealgorithmblockflowdiagramabove.
3.(PassCriterion2.3)Testsoftwaretoensureitmeetsthegivenspecification.Testtheprogramuntilitmeetsthegivenspecification.Pleaseprovidetheschematiccircuitofyourdesignandadetaileddescriptionoftheimplementationphenomenonofyourprogramintextandgraphicsortables.
MyReport
1Summarize
1.1Background
TheAT89S51isalow-power,high-performanceCMOS8-bitmicrocontrollerwith4KbytesofIn-systemProgrammableFlashmemory.Sothisdesignisbasedonit.Thisdesignisastudyonrotatinglightsandalarm.
1.2Designmethod
ThedesignisabuzzeralarmwithLEDlightstoachievewateron.Itshardwaremainlyconsistsoffourcomponents,aAT89C51microcontrollerchip,aswitchbutton,abuzzer,andLEDlights.
EightLEDlightsthroughtheP2portisconnectedwiththeAT89C51.TheSOUNDERthroughtheP3.0portisconnectedwiththeAT89C51.SwitchcontrolofthecircuitthroughP1.7.
Whentheswitchisopened,thecircuitwillbepowered.LEDlightsandthebuzzerrang.
2Overallsystemprogramandhardwaredesign
Intherecentresearch[梁炳东,2006]foundtheseinformation.
2.1C51MCUtubefeetandcharacteristics
IntegratedonasinglechipCPU,memory,RAM,ROMandinputandoutputinterfacecircuit,thechipusedtobeknownasthechipmicro-computer,referredtoasmicrocontrollers.INTELMCS-51microcontrollerisintroducedin1980,high-end8-bitmicrocontroller.Itstypicalproducts:
8051,8031,8751,80C51,80C31,87C51.
AT89C51pindiagram
2.2Buzzer
Buzzerisanintegratedstructureofanelectronicsounder,DCvoltagepowersupply.Buzzermainlydividesintothepiezoelectricbuzzerandsolenoidbuzzerstyletwokinds.
Buzzerschemes
2.3Hardwareconnectiondiagram
Originalrequirements:
1×
AT89C51,8×
LED-RED,9×
RES,1×
SOUNDER,1×
SW-SPDT
Hardwareconnectiondiagramasfollow:
Fig2.3
3SoftwareDesign
Intherecentresearch[李学礼,2008]foundtheseinformation.
3.1flowdiagram
Blockflowdiagramasfollow:
Intherecentresearch[梁炳东,2009]foundtheseinformation.
3.2Themainprogramsoftware
ORG00H
MAIN:
MOVP2,#00H
MOVP3,#00H
JBP1.7,MAIN/*Determinewhetherthealarm*/
MOVR2,#100
MOVA,#01H
B1000:
/*Havelow/highrate*/
CLRP3.0
LCALLDL0D5ms/*Delay*/
SETBP3.0/*Buzzerrang*/
LCALLDL0D5ms
DJNZR2,B1000/*DetermineR2=100*/
B500:
/*Havelow/highrate*/
LCALLDL0D5ms
JBP1.7,MAIN
DJNZR2,B500
MOVP2,A/*LEDlight*/
RLA/*otherLEDlight*/
SJMPB1000
DL0D5ms:
/*Delay*/
MOVR7,#250
DL:
DJNZR7,DL
RET
END
4Proteussoftwaresimulations
Theimplementationphenomenon
4.1Switchishigh:
4.2Switchislow
WhenP1.7ishigh,P2andP3portislow.WhenP1.7islow,P2andP3ishigh,theLEDlightandtheBuzzerrang.
5Summarize
5.1Myprogramadvantagesanddisadvantages
Advantages:
Myprogramissimple,shouldunderstand.
Disadvantages:
LEDandbuzzerprogramcannotachievesynchronization.Actualresultsandthedesiredoutcomehavealittledifferent.
Referencetemplates:
Books:
李学礼,2008.《基于Proteus的8051单片机实例教程》.第二版.北京:
电子工业出版社
梁炳东,2009.《单片机原理与应用》.第一版.北京:
人民邮电出版社