1 / 18

DJNZ Rn, rel DJNZ direct, rel CJNE A, direct, rel

复 习 一 . 计算机中的数和编码 1. 2,10,16 进制数及其之间的转换 ( 整数 ) 按权展开 , 除 x 取余 2. 无符号数与带符号数 求补码方法 无符号数 ( 大小判断原则 ) 带符号数 ( 大小判断原则 ) 3. BCD 码 ,ASCII 码及奇偶校验码 压缩性与非压缩性 BCD 码 ASCII 码 奇偶校验码.

bianca
Download Presentation

DJNZ Rn, rel DJNZ direct, rel CJNE A, direct, rel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 复 习一.计算机中的数和编码1. 2,10,16进制数及其之间的转换(整数)按权展开,除x取余2. 无符号数与带符号数 求补码方法 无符号数 (大小判断原则)带符号数 (大小判断原则) 3. BCD码,ASCII码及奇偶校验码 压缩性与非压缩性BCD码ASCII码 奇偶校验码

  2. 二. MCS-51单片机1. 系统结构A. 时钟电路,机器周期及指令周期B. 复位与复位电路C. I/O口:P0,P1,P2,P3 D. 引脚说明: RES ALE PSEN EA 2. 存储器组织 程序存储器 (MOVC) 0000H--FFFFH 内部数据存储器 (MOV) 00H--7FH <工作寄存器,位寻址区,堆栈区> 位地址 00H--FFH特殊功能寄存器 (MOV) 80H--FFH外部数据存储器 (MOVX) 0000H--FFFFH <与I/O统一编址>

  3. 3. MCS-51指令系统A. 寻址方式 (相对寻址中:转移地址=PC当+位移量) B. 专用寄存器 PC,A,SP,DPTR,PSW C. 指令(a) 传送: MOV A, Rn (direct,#data,@Ri) MOV Rn, A (direct,#data) MOV direct, A (Rn,@Rn,#data,direct) MOV @Ri, A (direct,#data) PUSH direct POP direct MOVX A, @DPTR (@Ri) MOVX @DPTR (@Ri), A MOVC A, @A+PC (@A+DPTR)

  4. XCH A, Rn( direct , @Ri ) XCHD A, @Ri MOV DPTR, #data16(b) 算术运算ADD A, Rn (direct,#data,@Ri) ADDC A, Rn (direct,#data,@Ri) SUBB A, Rn (direct,#data,@Ri) INC A ( Rn, direct, @Ri) INC DPTR DEC A (Rn, direct, @Ri) DAA MUL A, B DIV A, B

  5. (C) 逻辑运算CLR A CPL A RL A RR A RLC A RRC A SWAP A ANL A, Rn (direct,@Ri,#data) ANL direct, A (#data) ORL A, Rn (direct,@Ri,#data) ORL direct, A (#data) XRL A, Rn (direct,@Ri,#data) XRL direct, A (#data)

  6. (d) 位操作MOV C, bit MOV bit, C CLR C CLR bit CPL C CPL bit SETB C SETB bit ANL C, bit ANL C, /bit ORL C, bit ORL C, /bit

  7. (e) 控制转移LJMP addr16 AJMP addr11 SJMP rel JMP @A+DPTR JZ rel JNZ rel JC rel JNC rel JB bit, rel JNB bit, rel JBC bit, rel

  8. DJNZ Rn, rel DJNZ direct, rel CJNE A, direct, rel CJNE A, #data, rel CJNE Rn, #data, rel CJNE @Ri, #data, rel ACALL addr11 LACLL addr16 RET RETI NOP D.程序设计举例(看笔记,书)

  9. 定时器,计数器A. 结构: TMOD, TCON, TH0, TL0, TH1, TL1 B. 工作方式: 方式0,1,2,3 C. 应用: 定时初值的计算 重新赋初值的问题 定时器的启动,停止,与溢出概念5. 中断A. 与中断有关的寄存器: TCON SCON IE IP B.中断优先级,中断入口地址,中断响应. C.主程序与中断服务程序编写.6.串行接口A. 串行口控制寄存器: SCON, PCON, SBUF B. 工作方式: 方式0,1,2,3. (多机通信原理) C. 波特率计算.(T1溢出) D. 串行接收与发送程序编写.

  10. 三. MCS-51系统扩展1. 程序存储器扩展2. 数据存储器扩展3. I/O口扩展: 8255 8155 8253 74LS273 74LS244 4.D/A与A/D扩展: DAC0832 DAC1230 ADC0809 ADC0804 MC14433

  11. 四. MCS-51与键盘显示接口1. 显示接口 静态显示与动态显示 显缓区,字型表与显示查表程序2. 键盘接口,键扫描子程序3. 7279键盘/显示接口 接口电路 初始化程序 显示程序 键盘扫描程序

  12. 五. 思 考 题1. 采用T0定时,使DAC0832的U0输出如下图所示波形A. 电路

  13. B. 程序MAIN: MOV SP, #67H LP2: CLR A MOV TMOD, #01H MOV DPTR, #7F00H MOV TH0, #3CH MOVX @DPTR, A MOV TL0, #B0H LP3: MOV R7, #20H MOV IE, #88H LP4: DJNZ R7, LP4 MOV R2, #00H SJMP LP0 SETB R1 I -T0: MOV TH0, #3CH LP0: CJNE R2, #05H, LP1 MOV TL0, #B0H LP1: JNC LP2 INC R2 MOV A, #66H CJNE R2, #14H, LP5 MOV DPTR, #7F00H LP5: JC LP6 MOVX @DPTR, A MOV R2, #00H SJMP LP3 LP6: RETI

  14. 2. 8255A,B口接有2个数码管,C口接有8个开关.试编一程 序,用A,B口显示C口开关闭合值(即Ci口开关闭合,显示Ci),设8个开关只有一个闭合.A. 电路

  15. B. 程序ST: MOV DPTR, #BF03H ADD A, #0BH MOV A, #89H MOVC A, @A+PC MOVX DPTR, A MOV DPTR, #BF01H LP0: MOV DPTR, BF02H MOVX @DPTR, A MOVX A, @DPTR DEC DPL MOV R3, #00H MOV A, #C6H MOV R7, #08H MOVX @DPTR, A LP1: JNB ACC.0, LP2 SJMP LP0 INC R3 TAB: DB C0H, F9H,…86 RR A DJNZ R7, LP1 MOV R3, #0EH LP2: MOV A, R3

  16. 3. 试编一8通道采样程序,当某通道采样值>=E0H时,通 过 P1口的相应位发出报警信号.(即灯亮) A. 电路

  17. B. 程序ST: MOV R7, 08H MOV R2, #01H MOV R3, #FEH MOV R4, #00H LP0: MOV DPTR, #7FF8H MOVX @DPTR, A MOV R5, #1EH LP1: DJNZ R5, LP1 MOVX A, @DPTR CJNE A, #E0H, LP2 LP2: JNC LP3 MOV A, R4

  18. ANL A, R3 MOV A,R4 MOV R4, A MOV P1, A SJMP LP4 MOV R7, #F0H LP3: MOV A, R4 LP5: DJNZ R7, LP5 ORL A, R2 SJMP ST MOV R4, A LP4: MOV A, R2 RL A MOV R2, A MOV A, R3 RL A MOV R3, A INC DPTR DJNZ R7, LP0

More Related