串行接口应用.doc

  1. 1、本文档共10页,可阅读全部内容。
  2. 2、本文档内容版权归属内容提供方,所产生的收益全部归内容提供方所有。如果您对本文有版权争议,可选择认领,认领后既往收益都归您。
  3. 3、本文档由用户上传,本站不保证质量和数量令人满意,可能有诸多瑕疵,付费之前,请仔细先通过免费阅读内容等途径辨别内容交易风险。如存在严重挂羊头卖狗肉之情形,可联系本站下载客服投诉处理。
  4. 文档侵权举报电话:400-050-0739(电话支持时间:9:00-19:00)。
Overview The MCS?-51 family contains a flexible set of microcontrollers. These 8-bit embedded controllers have different features such as on-chip program memory, data RAM and some even have integrated A/D converters. One feature that all of the microcontrollers in the MCS?-51 family have in common is an integrated UART (Universal Asynchronous Receiver Transmitter). This guide has been designed so that any programmer with basic microcontroller experience can learn how to use the general features of the on-chip UART in a MCS?-51 microcontroller. This document has been created and designed in response to repeated inquires on the usage of the serial port. Working examples have been included and explained to ease the learning process. The serial port can operate in 4 modes: Mode 0: TXD outputs the shift clock. In this mode, 8 bits are transmitted and received by the same pin, RXD. The data is transmitted starting with the least significant bit first, and ending with the most significant bit. The baud rate is fixed at 1/12 the oscillator frequency. Mode 1: Serial data enters through the RXD pin and exits through the TXD pin. In this mode, a start bit of logic level 0 is transmitted then 8 bits are transmitted with the least significant bits first up to the most significant bit; following the most significant bit is the stop bit which is a logic 1. When receiving data in this mode, the stop bit is placed into RB8 in the SFR (Special Function Register) SCON. The baud rate is variable and is controlled by either timer 1 or timer 2 reload values. Mode 2: Serial data enters through the RXD pin and exits through the TXD pin. In this mode, a total of 11 bits are transmitted or received starting with a start bit of logic level 0, 8 bits of data with the least significant bit first, a user programmable ninth data bit, and a stop bit of logic level 1. The ninth data bit is the value of the TB8 bit inside the SCON register. This programmable bit is often used for parity informa

文档评论(0)

roman8899
该用户很懒,什么也没介绍

相关文档

相关课程推荐