早教吧 育儿知识 作业答案 考试题库 百科 知识分享

英语翻译15.2.OperationalModesUART0providesstandardasynchronous,fullduplexcommunication.TheUARTmode(8-bitor9-bit)isselectedbytheS0MODEbit(SCON0.7).TypicalUARTconnectionoptionsareshowninFigure15.3.15.2.1.8-BitUART8-BitUAR

题目详情
英语翻译
15.2.Operational Modes
UART0 provides standard asynchronous,full duplex communication.The UART mode (8-bit or 9-bit) is
selected by the S0MODE bit (SCON0.7).Typical UART connection options are shown in Figure 15.3.
15.2.1.8-Bit UART
8-Bit UART mode uses a total of 10 bits per data byte:one start bit,eight data bits (LSB first),and one stop
bit.Data are transmitted LSB first from the TX pin and received at the RX pin.On receive,the eight data
bits are stored in SBUF0 and the stop bit goes into RB80 (SCON0.2).
Data transmission begins when software writes a data byte to the SBUF0 register.The TI0 Transmit Interrupt
Flag (SCON0.1) is set at the end of the transmission (the beginning of the stop-bit time).Data reception
can begin any time after the REN0 Receive Enable bit (SCON0.4) is set to logic 1.After the stop bit is
received,the data byte will be loaded into the SBUF0 receive register if the following conditions are met:
RI0 must be logic 0,and if MCE0 is logic 1,the stop bit must be logic 1.In the event of a receive data overrun,
the first received 8 bits are latched into the SBUF0 receive register and the following overrun data bits
are lost.
If these conditions are met,the eight bits of data is stored in SBUF0,the stop bit is stored in RB80 and the
RI0 flag is set.If these conditions are not met,SBUF0 and RB80 will not be loaded and the RI0 flag will not
be set.An interrupt will occur if enabled when either TI0 or RI0 is set.
15.2.2.9-Bit UART
9-bit UART mode uses a total of eleven bits per data byte:a start bit,8 data bits (LSB first),a programmable
ninth data bit,and a stop bit.The state of the ninth transmit data bit is determined by the value in TB80
(SCON0.3),which is assigned by user software.It can be assigned the value of the parity flag (bit P in register
PSW) for error detection,or used in multiprocessor communications.On receive,the ninth data bit
goes into RB80 (SCON0.2) and the stop bit is ignored.
Data transmission begins when an instruction writes a data byte to the SBUF0 register.The TI0 Transmit
Interrupt Flag (SCON0.1) is set at the end of the transmission (the beginning of the stop-bit time).Data
reception can begin any time after the REN0 Receive Enable bit (SCON0.4) is set to ‘1’.After the stop bit
is received,the data byte will be loaded into the SBUF0 receive register if the following conditions are met:
(1) RI0 must be logic 0,and (2) if MCE0 is logic 1,the 9th bit must be logic 1 (when MCE0 is logic 0,the
state of the ninth data bit is unimportant).If these conditions are met,the eight bits of data are stored in
SBUF0,the ninth bit is stored in RB80,and the RI0 flag is set to ‘1’.If the above conditions are not met,
SBUF0 and RB80 will not be loaded and the RI0 flag will not be set to ‘1’.A UART0 interrupt will occur if
enabled when either TI0 or RI0 is set to ‘1’.
▼优质解答
答案和解析
UART0提供标准异步,全双工通信.UART方式(8位或9位)是
选择由S0MODE位(SCON0.7).典型的UART连接选择在表显示15.3.
15.2.1.8位UART
8-Bit UART方式使用总共10位每个数据字节:一个起始点、八个数据位元(首先LSB)和一中止
bit.数据是被传送的LSB首先从TX别针和接受在RX别针.在接受,八数据
bits在SBUF0被存放,并且结束位进入RB80 (SCON0.2).当软件给SBUF0记数器,写一个数据字节Data传输开始.TI0传送中断
Flag (SCON0.1)被设置在传输(停止位时间的初期的末端).数据招待会
can任何时侯开始,在REN0接受允许量(SCON0.4)之后被设置对逻辑1.在结束位以后是如果以下条件符合,received,数据字节将被装载入SBUF0接受记数器:
RI0必须是逻辑0,并且,如果MCE0是逻辑1在接受数据超出量情形下,结束位必须是逻辑1.,
the首先接受了8位被锁上入SBUF0接受记数器和以下超出量数据位元
are丢失了.
如果这些情况符合,八位数据在SBUF0被存放,结束位在RB80和被存放RI0设置旗子.如果这些情况没有符合,SBUF0和RB80不会被装载,并且RI0旗子不将
be集合.中断将发生,如果使能什么时候设置TI0或RI0.
15.2.2.9位UART
9-bit UART方式使用总共十一位每个数据字节:起始点,8个数据位元(首先LSB),一可编程序的
ninth数据位元和结束位.状态第九传送数据位元取决于在TB80 的价值
(SCON0.3),由用户软件分配.它可以被赋予同等旗子(在记数器的位P的价值
PSW)错失侦查的或者使用在多重处理机通信.在接受,第九个数据位元
goes到RB80 (SCON0.2)和结束位里被忽略.当指示给SBUF0记数器,写一个数据字节Data传输开始.TI0传送
Interrupt旗子(SCON0.1)被设置在传输(停止位时间的初期的末端).数据
reception可能任何时侯开始,在REN0接受允许量(SCON0.4)之后被设置对‘1’.在结束位以后如果以下条件符合,被接受的is,数据字节将被装载入SBUF0接受记数器:
(1) RI0必须是逻辑0和(2),如果MCE0是逻辑1,第9位必须是逻辑1 (当MCE0是逻辑0时,第九个数据位元的state是不重要的).如果这些情况符合,存放八位数据
SBUF0,第九位在RB80被存放,并且RI0旗子被设置对‘1’.如果上述条件没有符合,
SBUF0和RB80不会被装载,并且RI0旗子不会被设置对‘1’.UART0中断将发生,如果
enabled,当TI0或RI0被设置对‘1’.