MCS-51单片机电源控制与串行通信工作方式解析

需积分: 0 6 下载量 126 浏览量 更新于2024-08-09 收藏 5.74MB PDF 举报
"MCS-51单片机的电源控制寄存器及其串行通信" 在MCS-51系列单片机中,电源控制寄存器(PCON)是管理设备功耗和特定功能的关键组件。图5.22所示的电源控制寄存器包含以下几个重要的位: 1. **PD** 和 **IDL**: 这两个位用于控制单片机进入低功耗模式。当PD被置位(PD=1)时,单片机进入掉电模式,大部分内部电路都会停止工作,只保留RAM的内容。而IDL位若被置位(IDL=1),则在空闲模式下,CPU停止工作,但其他功能如定时器、串行口等仍可继续运行。 2. **GF1** 和 **GF0**: 这是两个供用户自定义使用的通用标志位,可用于软件标记或状态指示。 3. **SMOD**: 串行口波特率倍增位。SMOD位的设置会影响串行通信的波特率。当SMOD被置位(SMOD=1)时,串行口的波特率翻倍。在系统复位后,默认值为0,意味着波特率保持正常。 串行通信是MCS-51单片机的重要特性,相关的寄存器包括IE(中断允许寄存器)、IP(中断优先级寄存器)和SCON(串行控制寄存器)。为了配置单片机的串行口工作在方式1,允许接收和中断,并设置中断优先级为最高,可以执行以下三条汇编指令: ```汇编 MOV SCON, #50H ; 设置SCON寄存器,使能串行口方式1,允许接收(RI=1),允许中断(TI=1) MOV IP, #10H ; 设置IP寄存器,将串行口中断优先级设为最高 MOV IE, #90H ; 设置IE寄存器,开启串行口中断(ES=1) ``` MCS-51单片机的串行口支持四种工作方式,这些方式由SCON寄存器中的SM1和SM0位决定: 1. **工作方式0**: 在这种模式下,串行口作为同步移位寄存器操作。数据的传输以8位为一帧,从低位到高位。方式0常用于扩展I/O接口,此时SM2位必须为0。 2. **工作方式1**: 这是异步通信模式,常用于UART(通用异步收发传输器)通信。数据以9位的形式传输,包括1位起始位、8位数据位、1位可选的奇偶校验位和1位停止位。 3. **工作方式2** 和 **工作方式3**: 这两种方式主要用于SPI(串行外围接口)通信和多机通信,具有不同的数据帧格式和功能。 本书《单片机原理与应用及C51程序设计》由唐颖主编,详细介绍了MCS-51系列单片机的基础知识、汇编和C语言程序设计、硬件资源的利用以及接口技术。书中不仅提供了大量实例,还采用汇编与C语言对照编程的方式,旨在帮助读者理解和应用单片机技术,提高实践能力。这本书适合高校电气信息类专业学生学习,同时也适合作为工程技术人员的参考书。

翻译 This is Elsevier's new document class for typeset journal articles, elsarticle.cls. It is now accepted for submitted articles, both in Elsevier's electronic submission system and elsewhere. Elsevier's previous document class for typeset articles, elsart.cls, is now over 10 years old. It has been replaced with this newly written document class elsarticle.cls, which has been developed for Elsevier by the leading TeX developer STM Document Engineering Pvt Ltd. elsarticle.cls is based upon the standard LaTeX document class article.cls. It uses natbib.sty for bibliographical references. Bugs and problems with elsarticle.cls may be reported to the developers of the class via elsarticle@stmdocs.in. The file manifest.txt provides a list of the files in the elsarticle bundle. The following are the main files available: - elsarticle.dtx, the dtx file - elsdoc.pdf, the user documentation - elsarticle-template-num.tex, template file for numerical citations - elsarticle-template-harv.tex, template file for name-year citations - elsarticle-template-num-names.tex, template file for numerical citations + new natbib option. Eg. Jones et al. [21] - elsarticle-num.bst, bibliographic style for numerical references - elsarticle-harv.bst, bibliographic style for name-year references - elsarticle-num-names.bst, bibliographic style for numerical referencces + new natbib option for citations. To extract elsarticle.cls from *.dtx: latex elsarticle.ins The documentation file is elsdoc.tex in the contrib directory. To compile it: 1. pdflatex elsdoc 2. pdflatex elsdoc 3. pdflatex elsdoc

2023-06-01 上传