单片机试题及答案 3.docx
《单片机试题及答案 3.docx》由会员分享,可在线阅读,更多相关《单片机试题及答案 3.docx(10页珍藏版)》请在冰豆网上搜索。
单片机试题及答案3
单片机试题及答案(Singlechipexaminationquestionsandanswers)
A
Fillintheblanks(1pointsperminute,20points)
1.MonolithicmicrocomputerconsistsofCPU,memoryandthreeparts.
2,intheMCS-51system,whenthesignalisvalid,itmeansthatthesignalissentoutstablyfromtheP0port.
3,accessto8031piecesofexternaldatamemoryusingtheaddressingmode.
4,accumulator(A)=80H,executeinstructionADDA,#83H,carrybitsC=.
5,instructionLCALL37B0H,thefirstaddressin2000H,thecompletionoftheoperationisintothestack,senttoPC.
6,MCS-51interruptsource,2interruptpriority,prioritybythesoftwaretofillinthespecialfunctionregisterIPtochoose.
7,assemblylanguageandtwobasicinstructions.
In8,addressingmode,usingAasindexregisters,ortoregister.
9,interruptrequestsignaltriggerandtriggertwotriggermodes
10,usetheserialportextendedparallelport,serialinterfacemodeshouldbe.
11,74LS273isusuallyusedasasimpleinterfaceextension,while74LS244isoftenusedasasimpleinterfaceextension.
12,MCS-51parallelI/Oportinformationandtwokindsofreadingmethod,read-modify-writeoperationisforparallelI/Oportofthelatch.
13,threeimportantindexesofA/Dconverterare,andsumup.
Two,chooseaquestion(chooseacorrectanswerfromthealternativeanswer,andwritethecodeinparentheses.1pointsforeachquestion,10points
1.Thelanguagethatcomputerscanrecognizeis()
(A)assemblylanguage(B)naturallanguage(C)machinelanguage(C)high-levellanguage
2.WhentheMCS-51chipisusedtoexpandmemorychips,the4I/Oportsareusedasdatabuses
(A)P0andP2mouth(B)P0mouth(C)P2andP3mouth(D)P2mouth
3,atleastone()oftheinterruptserviceprogram
(A)transferinstruction(B)transferinstruction(C)additioninstruction(D)interruptreturninstruction
4.Thesignalthatdoesnotworkwhenaccessingexternalmemoryis()
(A)(B)(A)(A)ALE
5,thefollowinginstructions,readonlytheinstructionsofthepinis()
(A)MOVP1,A(B)ORLP1,#0FH(C)MOVCC,P1.5(D)DJNZP1,LAB
6,theuseoftimerT1,thereareseveralmodesofwork()
(A)1species(B),2species(C),3species(D),4species
7,ifMCS-51interruptsourcesareprogrammedasthesamelevel,whentheysimultaneouslyapplyinterrupts,CPUfirstresponds()
(A)(B)(C)T1(D)T0
8,whentheMCS-51responseisinterrupted,whichofthefollowingconditionsisnotnecessary?
Thecurrentinstructionisexecuted.B,interruptisopenC,nopeeroradvancedinterruptserviceD,andmusthaveRETIinstruction
9,ifthe8255portAissettomode2,theportBissetto()
(A)canonlybe0(B)or2(C)exceptformode2,andanyotherwaycan(D)anyway
10,whentheMCS-51multimachinecommunication,serialinterfacemodeshouldbe()
(A)mode0(B)mode1(C)mode2(D)mode0ormode2
Four.Readorwriteprograms(15points)
1.Writeaprogramtotransferthedatafromthe100unitsofthe1000Hunittothebeginningofthe2000H.(8points)
2.SetR0=20H,R1=25H,(20H)=80H,(21H)=90H,(22H)=A0H,(25H)=A0H,(26H)=6FH,(27H).Afterthefollowingprogramisexecuted,whatistheresult?
(20H)=(21H)=(22H)=(23H)=CY=
R0=R1=
CLRC
MOVR2,#3
环:
MOVA,R0
ADDCA,@R1
MOVR0,一
INCR0
公司R1
djnzR2,环
JNC下
MOVR0,#01h
否则,
下一步:
DECR0
否则,
五、MCS-51单片机外扩展一片2716存储器,画出系统电路原理图,写出地址分布。
(15分)
六、MCS-51单片机P1端口上,经驱动器接有只发光二极管fosc=8,6mhz,试编写程序,使这8只发光管每隔2秒循环发光。
(20分)
《单片微机原理及应用》一卷参考答案
一、填空题(每空1分,共20分)
1、I/O2、低83415位地址、寄存器间接、、2003h,37b06、5个,IP7、符号指令和伪指令8、PC或DPTR9、电平和脉冲10、方式0.11、输出输入12、读引脚和读锁存器13、转换速度、分辨率和转换精度。
二、选择题(从备选答案中选择一个正确答案,并将代号写在括号内。
每题1。
分,共10分)
1,C2,B3,D4,C5,C6,C7,B8,C9,A10,C
三、简答题(每题5分,共20分)
1、MCS-51单片机内部包括哪些主要逻辑功能部件?
答:
MCS-51单片机主要由下列部件组成:
1个8位CPU;
1个片内振荡器及时钟电路;
4kbROM程序存储器,256bram;
21个特殊功能寄存器;
2个16位定时/计数器;
4个8位并行I/O口及1个可编程全双工串行接口;
可寻址64kb的外部程序存储器空间;
可寻址64kb的外部数据存储器空间;
5个中断源、两个优先级中断嵌套中断结构。
2、MCS-51单片机内部有几个定时/计数器?
它们由哪些寄存器组成?
答:
MCS-51单片机内部有两个16位可编程的定时/计数器,简称定时器0(T0)和定时器1(T1)。
它们分别由方式寄存器TMOD、控制寄存器TCON和数据寄存器Th0、TL0,Th1、TL1组成。
3、单片机对中断优先级的处理原则是什么?
答:
(1)低优先级中断源可被高优先级中断源所中断,而高优先级中断源不能被任何中断源所中断;
(2)一种中断源(不管是高优先级还是低优先级)一旦得到响应,与它同级的中断源不能再中断它。
当同时收到几个同一优先级的中断时,响应哪一个中断源取决于内部查询顺序。
其优先级排列如下:
中断源同级内的中断优先级
0最高外部中断
定时器/计数器0溢出中断
外部中断1
定时器/计数器1溢出中断
串行口中断最低
4、设MCS-51单片机的Fosc=12MHz,要求用T0定时150us,分别采用定时方式0,定时方式1和方式2时的定时初值。
采用方式0定时的初值为FBH,50h
采用方式1定时的初值为FFH,6ah
采用方式2定时的初值为6ah
四、阅读或编写程序
1、编写一程序实现将1000h单元开始的100个单元的数据转移到2000h开始的单元中。
(8分)
程序如下:
ORG0000H
MOVDPTR,#1000h;给源数据块地址指针DPTR赋初值
MOVP2,#20h;给目的数据块地址指针P2和R0赋初值
MOVR0,#00h
环:
MOVX指令,指令
MOVX@R0,一
INCDPTR
INCR0
cjneR0,#64h,环
否则,
2、设R0=20h,
R125h(20h)=====90h80h,(21h),(22h)=(a0h,25h)=(a0h,26h)=(6fh,27h),afterthefollowingprogramisexecuted,whatistheresult(7points)?
(20h)=(=21h(20h)00h22h)=(23h17h01hCYA=1)===28h17hR023hR1
CL