51系列单片机资料汇总
[size=5]概述[/size]:[size=1][size=24pt][b]CPU[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]:以[/b][/size][/color][/font][size=24pt][b]ALU[/b][/size][font=仿宋_GB2312][size=24pt][b][color=Blue]为中心的运算器,以定时控制逻辑为中心的控制器,[/color][/b][/size][/font][/size]
[font=宋体][color=Green][size=24pt][b]包括运算器和控制器二大部分。[/b][/size][/color][/font][size=133%][align=left][font=Wingdings][size=80%]l[/size][/font][/align][/size][font=仿宋_GB2312][color=Green][size=24pt][b]运算器:[/b][/size][/color][/font][font=宋体][size=3][color=Green][size=24pt][b]包括算术/逻辑运算部件[/b][b](ALU)[/b][b]、布尔处理器、暂存器、累加器[/b][b]A[/b][b]、寄存器[/b][b]B[/b][b]、程序状态字寄存器([/b][b]PSW[/b][b])等等。运算器主要用于实现算术[/b][b]/[/b][/size][size=24pt][b]逻辑运算、位操作运算和数据传送等操作。[/b][/size][/color][/size][size=3][size=24pt][/size]
[size=24pt][b]算术/逻辑部件[/b][/size][size=24pt][b]ALU[/b][/size][/size][size=3][size=24pt][/size][size=24pt][b]累加器[/b][/size][size=24pt][b]A:[/b][/size][/size][font=仿宋_GB2312][color=Red][size=28pt][b]地址:[/b][/size][/color][/font][size=28pt][b]E0H[/b][/size][size=3][color=Red][size=24pt][/size][size=24pt][b]寄存器[/b][b]B:[/b][/size][/color][/size][font=仿宋_GB2312][color=Red][size=28pt][b]地址:[/b][/size][/color][/font][size=28pt][b]F0H[/b][/size][size=3][color=Red][size=24pt][/size][size=24pt][b]程序状态字寄存器[/b][b]PSW:[/b][/size][/color][/size][/font][font=宋体][color=Red][font=仿宋_GB2312][color=Green][size=28pt][b]地址:D[/b][/size][/color][/font][size=28pt][b]0H[/b][/size][/color][/font][font=宋体][size=3][color=Red][size=24pt][/size][/color][/size][size=111%]
[/size][size=20pt][b]C[/b][/size][size=13pt][b]Y[/b][/size][size=20pt][b](PSW[/b][/size][font=Arial][color=Red][size=20pt][b]·[/b][/size][/color][/font][size=20pt][b]7):[/b][/size][font=宋体][color=Red][size=20pt][b]进位标志位。加法(或减法)运算时,运算结果最高位有进位或借位,则[/b][/size][/color][/font][size=20pt][b]C[/b][/size][size=13pt][b]Y[/b][/size][font=宋体][color=Red][size=20pt][b]自动置[/b][/size][/color][/font][font=Arial][color=Red][size=20pt][b]“[/b][/size][/color][/font][size=20pt][b]1[/b][/size][font=Arial][color=Red][size=20pt][b]”[/b][/size][/color][/font][font=宋体][color=Red][size=20pt][b],否则[/b][/size][/color][/font][size=20pt][b]C[/b][/size][size=13pt][b]Y[/b][/size][font=宋体][color=Red][size=20pt][b]置[/b][/size][/color][/font][font=Arial][color=Red][size=20pt][b]“[/b][/size][/color][/font][size=20pt][b]0[/b][/size][font=Arial][color=Red][size=20pt][b]”[/b][/size][/color][/font][font=宋体][color=Red][size=20pt][b],在进行布尔操作运算时,[/b][/size][/color][/font][size=20pt][b]C[/b][/size][size=13pt][b]Y[/b][/size][font=宋体][color=Red][size=20pt][b](简称[/b][/size][/color][/font][size=20pt][b]C[/b][/size][font=宋体][color=Red][size=20pt][b])作为布尔累加器。[/b][/size][/color][/font]
[size=111%][align=left][font=Wingdings][size=70%]l[/size][/font][/align][/size][size=20pt][b]AC(PSW[/b][/size][font=Arial][color=Red][size=20pt][b]·[/b][/size][/color][/font][size=20pt][b]6):[/b][/size][font=宋体][color=Red][size=20pt][b]辅助进位标志位。加法或减法时,若低[/b][/size][/color][/font][size=20pt][b]4[/b][/size][font=宋体][color=Red][size=20pt][b]位向高[/b][/size][/color][/font][size=20pt][b]4[/b][/size][font=宋体][color=Red][size=20pt][b]位有进位(或借位)时,[/b][/size][/color][/font][size=20pt][b]AC[/b][/size][font=宋体][color=Red][size=20pt][b]被置[/b][/size][/color][/font][font=Arial][color=Red][size=20pt][b]“[/b][/size][/color][/font][size=20pt][b]1[/b][/size][font=Arial][color=Red][size=20pt][b]”[/b][/size][/color][/font][font=宋体][color=Red][size=20pt][b],否则[/b][/size][/color][/font][size=20pt][b]AC[/b][/size][font=宋体][color=Red][size=20pt][b]被置[/b][/size][/color][/font][font=Arial][color=Red][size=20pt][b]“[/b][/size][/color][/font][size=20pt][b]0[/b][/size][font=Arial][color=Red][size=20pt][b]”[/b][/size][/color][/font][font=宋体][color=Red][size=20pt][b]。在十进制调整指令中[/b][/size][/color][/font][size=20pt][b]AC[/b][/size][font=宋体][color=Red][size=20pt][b]还作为十进制调整的判别位。[/b][/size][/color][/font]
[size=20pt][b]F0(PSW[/b][/size][font=Arial][color=Red][size=20pt][b]·[/b][/size][/color][/font][size=20pt][b]5):[/b][/size][font=宋体][color=Red][size=20pt][b]用户标志位。用户可用软件对[/b][/size][/color][/font][size=20pt][b]F0[/b][/size][font=宋体][color=Red][size=20pt][b]位置[/b][/size][/color][/font][font=Arial][color=Red][size=20pt][b]“[/b][/size][/color][/font][size=20pt][b]1[/b][/size][font=Arial][color=Red][size=20pt][b]”[/b][/size][/color][/font][font=宋体][color=Red][size=20pt][b]或清[/b][/size][/color][/font][font=Arial][color=Red][size=20pt][b]“[/b][/size][/color][/font][size=20pt][b]0[/b][/size][font=Arial][color=Red][size=20pt][b]”[/b][/size][/color][/font][font=宋体][color=Red][size=20pt][b]以决定程序的流向。[/b][/size][/color][/font]
[color=Red][color=Red][size=20pt][b]OV(PSW[/b][/size][font=Arial][size=20pt][b]·[/b][/size][/font][size=20pt][b]2):[/b][/size][font=宋体][size=20pt][b]溢出标志位,当运算结果溢出时[/b][/size][/font][size=20pt][b]OV[/b][/size][font=宋体][size=20pt][b]置[/b][/size][/font][font=Arial][size=20pt][b]“[/b][/size][/font][size=20pt][b]1[/b][/size][font=Arial][size=20pt][b]”[/b][/size][/font][font=宋体][size=20pt][b],否则为[/b][/size][/font][font=Arial][size=20pt][b]“[/b][/size][/font][size=20pt][b]0[/b][/size][font=Arial][size=20pt][b]”[/b][/size][/font][font=宋体][size=20pt][b],此标志[/b][/size][/font][font=宋体][size=20pt][b]位反映了运算结果是否溢出。[/b][/size][/font][size=20pt][b]OV[/b][/size][font=宋体][size=20pt][b]=[/b][/size][/font][size=20pt][b]C[/b][/size][size=13pt][b]7[/b][/size][font=宋体][size=20pt][b]○[/b][/size][/font][size=20pt][b]C[/b][/size][size=13pt][b]6[/b][/size][/color][/color]
[font=宋体][color=Red][b](有符号数超过范围:[/b][/color][/font][color=Red][color=Red][b]-128[/b][/color][/color][font=宋体][color=Red][b]~[/b][/color][/font][color=Red][color=Red][b]127[/b][/color][/color][font=宋体][color=Red][b]乘法积超过[/b][/color][/font][color=Red][color=Red][b]255[/b][/color][/color][font=宋体][color=Red][b]除数为[/b][/color][/font][b]0)[/b]
[size=20pt][b]PSW.1[/b][/size][font=宋体][color=Red][size=20pt][b]:未定义位。[/b][/size][/color][/font]
[color=Red][size=20pt][b]P[/b][/size][font=宋体][size=20pt][b]([/b][/size][/font][size=20pt][b]PSW[/b][/size][font=Arial][size=20pt][b]·[/b][/size][/font][size=20pt][b]0[/b][/size][font=宋体][size=20pt][b]):奇偶标志位。[/b][/size][/font][size=20pt][b]MCS-51[/b][/size][font=宋体][size=20pt][b]单片机采用的是[/b][/size][/font][font=宋体][size=20pt][b]偶[/b][/size][/font][font=宋体][size=20pt][b]校验。当累加器[/b][/size][/font][size=20pt][b]A[/b][/size][font=宋体][size=20pt][b]中[/b][/size][/font][font=Arial][size=20pt][b]“[/b][/size][/font][size=20pt][b]1[/b][/size][font=Arial][size=20pt][b]”[/b][/size][/font][font=宋体][size=20pt][b]的个数为奇数时,[/b][/size][/font][size=20pt][b]P[/b][/size][font=宋体][size=20pt][b]置[/b][/size][/font][font=Arial][size=20pt][b]“[/b][/size][/font][size=20pt][b]1[/b][/size][font=Arial][size=20pt][b]”[/b][/size][/font][font=宋体][size=20pt][b],否则[/b][/size][/font][size=20pt][b]P[/b][/size][font=宋体][size=20pt][b]置[/b][/size][/font][font=Arial][size=20pt][b]“[/b][/size][/font][size=20pt][b]0[/b][/size][font=Arial][size=20pt][b]”[/b][/size][/font][font=宋体][size=20pt][b]。此位反映累加器[/b][/size][/font][size=20pt][b]A[/b][/size][font=宋体][size=20pt][b]中内容[/b][/size][/font][font=Arial][size=20pt][b]“1”[/b][/size][/font][font=宋体][size=20pt][b]的奇偶性,用于机间通信。[/b][/size][/font][size=20pt][b]RS1(PSW[/b][/size][font=Arial][size=20pt][b]·[/b][/size][/font][size=20pt][b]4)[/b][/size][font=宋体][size=20pt][b]、[/b][/size][/font][size=20pt][b]RS0(PSW[/b][/size][font=Arial][size=20pt][b]·[/b][/size][/font][size=20pt][b]3)[/b][/size][font=宋体][size=20pt][b]:工作寄存器组选择位。用来选择当前工作的寄存器组。每个寄存器组有[/b][/size][/font][size=20pt][b]8[/b][/size][font=宋体][size=20pt][b]个[/b][/size][/font][size=20pt][b]8[/b][/size][font=宋体][size=20pt][b]位得工作寄存器。用户通过改变[/b][/size][/font][size=20pt][b]RS1 [/b][/size][font=宋体][size=20pt][b]、[/b][/size][/font][size=20pt][b]RS0[/b][/size][font=宋体][size=20pt][b]的内容来选择[/b][/size][/font][font=宋体][size=20pt][b]当前工作寄存器组。[/b][/size][/font][size=20pt][b]RS1[/b][/size][font=宋体][size=20pt][b]、[/b][/size][/font][size=20pt][b]RS0[/b][/size][font=宋体][size=20pt][b]的内容与工作寄存器组的对应关系如表所示。[/b][/size][/font]
[table=50%][tr][td] RS1[/td][td] RS0[/td][td] 寄存器组[/td][td] RAM地址[/td][td] 寄存器组名称[/td][/tr][tr][td] 0[/td][td] 0[/td][td] 0[/td][td] 00H-07H[/td][td] R0-R7[/td][/tr][tr][td] 0[/td][td] 1[/td][td] 1[/td][td] 08H-0FH[/td][td] R0-R7[/td][/tr][tr][td] 1[/td][td] 0[/td][td] 2[/td][td] 10H-17H[/td][td] R0-R7[/td][/tr][tr][td] 1[/td][td] 1[/td][td] 3[/td][td] 18H-1FH[/td][td] R0-R7[/td][/tr][/table]
[font=仿宋_GB2312][size=28pt][b]控制器[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]程序计数器[/b][/size][/font][size=24pt][b]PC[/b][/size][font=仿宋_GB2312][size=24pt][b]([/b][/size][/font][size=24pt][b]16[/b][/size][font=仿宋_GB2312][size=24pt][b][color=Red]位)[/color][/b][/size][/font]
[size=24pt][/size][font=仿宋_GB2312][size=24pt][b]程序计数器[/b][/size][/font][size=24pt][b]PC[/b][/size][font=仿宋_GB2312][size=24pt][b]的功能与普通微机相同,它用来存放[/b][/size][/font][size=24pt][b]CPU[/b][/size][font=仿宋_GB2312][size=24pt][b]执[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]行的下一条指令的地址。当一条指令按照[/b][/size][/font][size=24pt][b]PC[/b][/size][font=仿宋_GB2312][size=24pt][b]所指的地址从程序[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]存储器中取出后,[/b][/size][/font][size=24pt][b]PC[/b][/size][font=仿宋_GB2312][size=24pt][b]会自动加[/b][/size][/font][size=24pt][b]1[/b][/size][font=仿宋_GB2312][size=24pt][b],指向下一条指令。程序计数[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]器[/b][/size][/font][size=24pt][b]PC[/b][/size][font=仿宋_GB2312][size=24pt][b]是一个[/b][/size][/font][size=24pt][b]16[/b][/size][font=仿宋_GB2312][size=24pt][b]位的寄存器,可寻址[/b][/size][/font][size=24pt][b]64KB[/b][/size][font=仿宋_GB2312][size=24pt][b]的程序存储器空间。[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]不可对[/b][/size][/font][size=24pt][b]PC[/b][/size][font=仿宋_GB2312][size=24pt][b]寻址,不能读写。[/b][/size][/font]
[font=仿宋_GB2312][size=24pt][b]堆栈指针[/b][/size][/font][size=24pt][b]SP[/b][/size][font=仿宋_GB2312][size=24pt][b]([/b][/size][/font][size=24pt][b]8[/b][/size][font=仿宋_GB2312][size=24pt][b][color=Red]位)[/color][/b][/size][/font]
[size=24pt][/size][font=仿宋_GB2312][size=24pt][b]先进后出,[/b][/size][/font][size=24pt][b]SP[/b][/size][font=仿宋_GB2312][size=24pt][b]总是指向栈顶且装有数据[/b][/size][/font][size=24pt][b].[/b][/size][font=仿宋_GB2312][size=24pt][b]数据称为[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]堆栈元素。[/b][/size][/font]
[color=Red]
[font=仿宋_GB2312][size=24pt][b]数据指针[/b][/size][/font][size=24pt][b]DPTR[/b][/size][font=仿宋_GB2312][size=24pt][b]([/b][/size][/font][size=24pt][b]16[/b][/size][font=仿宋_GB2312][size=24pt][b]位)[/b][/size][/font][size=20pt][b]DPH[/b][/size][font=仿宋_GB2312][size=20pt][b]:[/b][/size][/font][size=20pt][b]DPTR[/b][/size][font=仿宋_GB2312][size=20pt][b]的高位字节,[/b][/size][/font][size=20pt][b]DPL[/b][/size][font=仿宋_GB2312][size=20pt][b]:[/b][/size][/font][size=20pt][b]DPTR[/b][/size][font=仿宋_GB2312][size=20pt][b]的低位字节[/b][/size][/font][/color][/color][/font][size=1][font=仿宋_GB2312][size=24pt][/size][/font][/size][size=133%][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]内部数据寄存器:字节地址[/b][/size][/color][/font][size=24pt][b]
00H[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]~[/b][/size][/color][/font][size=24pt][b][color=Blue]7FH[/color]
[/b][/size][color=Blue][size=133%][b][size=90%]①[/size][/b][/size][font=仿宋_GB2312][size=24pt][b]内部程序存储器:[/b][/size][/font][size=24pt][b]8051[/b][/size][font=仿宋_GB2312][size=24pt][b]系列[/b][/size][/font][size=24pt][b]
8K[/b][/size][font=仿宋_GB2312][size=24pt][b]字节[/b][/size][/font][size=24pt][b]0000H[/b][/size][font=仿宋_GB2312][size=24pt][b]~[/b][/size][/font][size=24pt][b]FFFFH[/b][/size][/color]
[font=仿宋_GB2312][color=Blue][size=24pt][b]定时[/b][/size][/color][/font][size=24pt][b]/[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]计数器:[/b][/size][/color][/font][size=24pt][b]8051[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]系列[/b][/size][/color][/font][size=24pt][b]
2[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]×[/b][/size][/color][/font][size=24pt][b]16[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]位[/b][/size][/color][/font][size=24pt][b]8052[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]系列[/b][/size][/color][/font][size=24pt][b]
3[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]×[/b][/size][/color][/font][size=24pt][b]16[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]位[/b][/size][/color][/font][size=133%][b][size=90%]⑤[/size][/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]并行[/b][/size][/color][/font][size=24pt][b]I/O[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]口[/b][/size][/color][/font][size=24pt][b]:P0[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]、[/b][/size][/color][/font][size=24pt][b]P1[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]、[/b][/size][/color][/font][size=24pt][b]P2[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]、[/b][/size][/color][/font][size=24pt][b]P3
[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]共[/b][/size][/color][/font][size=24pt][b]4[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]组[/b][/size][/color][/font][size=24pt][b]
32[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]根[/b][/size][/color][/font][size=24pt][b]I/O[/b][/size][font=仿宋_GB2312][color=Blue][size=24pt][b]口线[/b][/size][/color][/font][color=Blue][font=仿宋_GB2312][size=24pt][b]串口:一个全双工串行口[/b][/size][/font][size=133%][b][size=90%]⑤[/size][/b][/size][font=仿宋_GB2312][size=24pt][b]中断系统:中断系统是为了使单片机具有实时控制能力而设计的内部电[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]路,两个优先级[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]时钟电路:外部晶振[/b][/size][/font][size=133%][b][size=90%]⑤[/size][/b][/size][font=仿宋_GB2312][size=24pt][b]位处理器:将[/b][/size][/font][size=24pt][b]PSW[/b][/size][font=仿宋_GB2312][size=24pt][b]中的[/b][/size][/font][size=24pt][b]Cy[/b][/size][font=仿宋_GB2312][size=24pt][b]位作为位累加器使用,地址20H-2FH[/b][/size][/font][font=仿宋_GB2312][size=24pt][b]总线:[/b][/size][/font]
[/color]
[font=仿宋_GB2312][size=24pt][/size][/font]
[[i] 本帖最后由 RFID-device 于 2008-8-1 21:06 编辑 [/i]] 不理想啊 偶是这个方面的白痴 是硬件方面的白痴...
页:
[1]