单片机原理和应用第二版张毅刚课后习题答案解析 - 百度文库

ʽжϴͷʽAT89S51жϹܺI/OӿڵжϹʵI./OݵĴ͡Ƭֻ׼ú󣬷ݴ󣬲ж򣬶ݴ͵жϷ򣬽ݵĴ͡жϷɺִַСˣжϷʽɴ߹Чʡ

4֡(1) ַʽַʽI/Oַռʹ洢ַռַַֿŵI/Oַռʹ洢ַռ໥޷ȴҪһרŵĶдI/OָͿźš(2) ͳһַʽַʽǰI/O˿ڵļĴݴ洢ԪͬȶԴͳһбַͳһַŵDzҪרŵI/Oָֱʹ÷ݴ洢ָI/OAT89S51ƬʹõI/Oⲿݴ洢RAMͳһַķʽ

5 82C55ͨдּĴĿֵλжϣλΪ1ʱΪʽ֣λΪ0ʱΪCڰλλ/λ֡

6𣺱Ҫ82C55CڵIJ䷽ʽֵλΪ0ʱλװöCøλĿ֪ʽƼĴĵַΪ7FFFH

ORG 0100H

ּĴַ7FFFHDPTR PC70

MAIN: MOV DPTR,#7FFFH

MOV A,#0EH MOVX @DPTR,A MOV A,#09H MOVX @DPTR,A END

PC41

7𣺵һݲ͵PA7PA0ʱ豸Զѡͨ

A

82C55һ͵ƽѡͨźţPA7-PA0ݴPAڵݻ/Ȼʹ뻺IBFAɸߵƽ֪ͨ豸82C55PAյݡ82C55⵽

A

ɵ͵ƽ˸ߵƽIBFA

Ϊ1״̬жINTEAΪ1ʱʹINTRɸߵƽAT89S51APC3ж󡣣INTEA״̬ûͨPC4λ/λơAT89S51ӦжϺ󣬿ͨжϷPAڵݻ/ȡ跢ݡݱCPUߺ82C55INTRAϵж󣬲ʹIBFAΪ͵ƽ֪ͨһݡ

881C55Ķ˿¼֣/״̬ĴPAڡPBڡPCڡĸ8λĴ8λĴԼRAMԪIO/

A2A1A0˿

ַTIMERINǼţڶ81C55Ƭڵ14λ1TIMEROUTΪš14λΪ0ʱͿڸ򷽲źŵIJѡļʽйء

9𣺵·ͼԲοͼ9-10PAÿһλӶܵܵĸӵءPBÿ1λһغ裬һֱӽӵءֻҪPBڵֵ͸PAھͿĿҪˡ

ORG 0100H

MOV A#10000010B

PAڷʽ0PBڷʽ0

MIAN

MOV DPTR#0FF7FH ƿڵַDPTR MOVX DPTRA

ͷʽ

MOV DPTR#0FF7DH PBڵַDPTR MOVX ADPTR

뿪Ϣ

MOV DPTR#0FF7CH PAڵַDPTR MOVX DPTRA END

PAڵPBڵӦĶ

1081C55ijֵΧǣ3FFFH-2HƵΪ4MHzֵΪ3FFFHʱʱʱΪ0.004096S

11𣺽1MHzıΪ10msķʵϾǷƵƵǰƵ֮Ϊ100:1ֻҪʱֵΪ64HͿˡI/OڵַΪ

7F00H-7F05H

START MOV

DPTR#7F04H ָָ8λ A#64H DPTRA

DPTR

ͳֵA

ֵ͸8λ ָ8λ

MOV MOVX INC

MOV MOVX MOV MOV MOVX END

A#40H DPTEA

DPTR#7F00H ָ/״̬ A#0C2H DPTEA

10 AT89S51̡ʾ̡ӡĽӿ

ο

1. A MAX7219רʾоƬڼ̣BCH451оƬҲڿƼ̣Cԣ BUSYźſΪѯźŻжźʹãʱźACKãELEDܵǿԱģ10-1еġaζӦֽڵλdpζӦֽڵλ͸ıˡ

2. ڰıպϺͶϿУڿصĻеԣ˰IJĻе״̬ȡпִܳһDzӲȥȥԭڵһμ⵽мʱüӦΪ͵ƽִһʱ10msӳȷϸߵƽǷȻΪ͵ƽΪ͵ƽȷΪȷʵм¡

3. 𣺾̬ʾʱǷֿ͵ÿһλLEDϵġ̬ʾͬʱ

ÿһLEDϣٸλѡȷһλLEDʾ̬ʾȺܸߣռý϶ࡣ̬ʾռý٣ʺʾλ϶ijϡ

4. 80H7FH

5. 𣺰С߽ϣС߷ֱӵصˡͨӵ+5Vϣްʱߴڸߵƽ״̬аʱߵƽ״̬ߵĵƽߵĵƽΪͣߵƽΪͣߵĵƽΪߣߵĵƽΪߡСźʵĴȷպϼλá

6. ȶP1ڸλ͵͵ƽȡP1ڵλֵٶP1ڵλ͵͵ƽȡP1ڸλֵζֵһ͵õ˰룬ڸҼֵ

KEYIN: MOV

MOV ANL

P1,#0FH A,P1 A,#0FH B,A P1,#0F0H A,P1 A,#0F0H A,B

ת

MOV MOV MOV ANL ORL

CJNE A,#0FFH,KEYIN1 RET

δ ݴ

ָ

KEYIN1: MOV B,A

MOV

DPTR,#KEYCOD

ϵͷ779662525#qq.com(#滻Ϊ@)