1、1 1.1 1.2 CPUI/O1.3 C1.4 B1.5 CPUDSPARM7ARM9CPU1.6 MCS-51803180518071803180514KROM87514KEPROM1.7 MCS-51MCSIntel5180511.8 MCS-5187C51AT89S514KFlash87C514KEPROM1.9 DSPFFTDSPDSPDSPCPU(RTOS)RTOS ATM1.10 DSP 2 AT89S511AT89S5111CPU2128RAM 34K Flash448I/OP0P1P2P3516216/71852925SFR1012 4K FlashPC0FFFH4K 000
2、0HFFFFH4K Flash32s41125. 64K55 5 0003H 0 ( )000BH 0 (T0)0013H 1 ( )001BH 1 (T1)0023H 6. 28H88H750H88H8P09ABCD10. 04H00H011(A) (B) (C) (D) 12. 00H-1FH13(A) (B) (C) (D) 14 (C)15. PCPC1664K17P08LSTTLP1P2P3P0P0400mAP00.45V3.2mA1819. (A) (B) CD20. (A) (B) CD3 AT89S5111234567891011122ABCD3APCDPTR456. 1031
3、H789AB10A=50HSP=50H51H=30H52H=50HPC5030H11AANL A#87HBANL A#0C3HCORL A#0CH12A=0CBH13A=00HR3=0AAH14DPH=3CHDPL=5FHSP=50H15SP=62H61H=30H62H=70H16 MOV R7APUSH AccMOV ABMOVX DPTRA17D18C1951RAM00H7FH80HFFHRAMR0R1R0R17FH52RAM00HFFHR0R14 AT89S511ORGORiGinEND(END of assembly)EQUEQUateDBDefine ByteDWDefine Wor
4、dDSDefine StorageBIT 2 3-2-()-31000H(16)4D 41 49 4E 12 34 30 0000 70 78 7F E4 F6 D8 FD75 81 07 02412 ACALL addr11 52KB LCALL addr16addr1664KB34RET55MOV A45HANL A#0FHORL A#0FHMOV 45HA6A=80H SP=40H(41H)=50H(42H)=80H PC=8050H7START MOV R0,#30HMOV R2,#20HLOOP: MOV A,R0CJNE A,#0AAH,NEXTMOV 51H,#01HLJMP E
5、XITNEXT: INC R0DJNZ R2,LOOPMOV 51H,#00HEXIT: RET8START MOV 41H,#0MOV R0#20HMOV R2#20HLOOP MOV A,R0JNZ NEXTINC 41HNEXT INC R0DJNZ R2LOOPRET9ORG 0100HMOV R2, #20H MOV A , #21HMOV R1 , ADEC R2MOV A , R1LOOP: MOV R3,ADEC R1CLR CSUBB AR1JNC LOOP1MOV AR1SJMP LOOP2LOOP1: MOV A,R3LOOP2: DJNZ R2, LOOPMOV R0,
6、ARET101SP=SP+1=61H (61H)=PC=03HSP=SP+1=62H (62H)=PC=20H2PC=3456H342KB2048 Byte11ORG 0100HDEL: MOV R7, #200DEL1: MOV R6, #123 ; -125123DEL2: DJNZ R6, DEL2NOP ; DJNZ R7, DEL1RET1+(1+123*2+1+2)*200+2=50003us=50.003ms5 AT89S5110013H001BH2; 13 RETIRET4D5 AT89S5138AT89S511AT89S5123RETIIEIPAT89S516D7PCPC8:
7、 SETB IT1SETB EX1SETB EA9A101IEEA=1213 =1411ACD125-10ORG 0000HLJMP MAINORG 0013HLJMP INT_EX1ORG 0030HMAIN: CLR IT0SETB EX1 1SETB EAWAIT: MOV PCON,#01H NOPLJMP WAIT 1INT_EX1 JB P1.2NEXT1 3LJMP INT_IR3 3NEXT1: JB P1.1NEXT2 2LJMP INT_IR2 2NEXT2: LJMP INT_IR1 1ORG 1000HINT_IR3: RETI ORG 1100HINT_IR2: RE
8、TI ORG 1200HINT_IR1: RETI 6 AT89S51/1ABCD2/01262.144ms21024ms3/12412241/245/T0/T0ORG0000HLJMP MAINORG000BHLJMP IT0PMAIN:MOV TMOD,#06H/T02MOV TL0,#156100MOV TH0,#156SETB GATESETB TR0T0SETB ET0T0SETB EACPUCLR F0WAIT: AJMP WAITIT0P: CLR EACPUJB F0,COUNTF0=1MOVTMOD,#00H /T00MOVTH0,#0FEH 1msMOVTL0,#0CHSETB EARETICOUNT: MOV TMOD,#06HMOVTL0,#156SETB EARETI6. /27. P1.010:1363.63s36.37s6MHzT cy=2s364s36sORG 0000HLJMP MAINORG000BHLJMP IT0PMAIN: MOV TMOD,#02H /T02MOVTL0,#4AH 364sSETB TR0 T0SETB