📄 dpjjx23.htm
字号:
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></font><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>方式</font><FONT SIZE=2>0</LI></font><FONT SIZE=3></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>方式</font><FONT SIZE=2>0</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>的波特率固定为主振频率的</FONT><FONT SIZE=2>1/12</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>。</font></P><FONT FACE="宋体" LANG="ZH-CN" SIZE=3>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></FONT><LI>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>方式</font><FONT SIZE=2>2</LI></font><FONT SIZE=3></p>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P></font></OL>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>方式</font><FONT SIZE=2>2</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>的波特率由</FONT><FONT SIZE=2>PCON</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>中的选择位</FONT><FONT SIZE=2>SMOD</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>来决定,可由下式表示:</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>波特率</font><FONT SIZE=2>=2的SMOD次方除以64再乘一个fosc,也就是</font><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>当</font><FONT SIZE=2>SMOD=1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>时,波特率为</FONT><FONT SIZE=2>1/32fosc</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>,当</FONT><FONT SIZE=2>SMOD=0</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>时,波特率为</FONT><FONT SIZE=2>1/64fosc</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT SIZE=2>3</font><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>.方式1和方式</FONT><FONT SIZE=2>3</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>定时器</font><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>作为波特率发生器,其公式如下:</font></P><FONT FACE="宋体" LANG="ZH-CN" SIZE=3>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>波特率</font><FONT SIZE=2>=</font><font face="宋体" lang="ZH-CN" size=2><img src="Image5.gif" width="52" height="43">定时器T1溢出率
</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT SIZE=2> T1</font><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>溢出率</FONT><FONT SIZE=2>= T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>计数率</FONT><FONT SIZE=2>/</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>产生溢出所需的周期数</font></P><FONT FACE="宋体" LANG="ZH-CN" SIZE=3>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0"></P>
</FONT>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>式中</font><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>计数率取决于它工作在定时器状态还是计数器状态。当工作于定时器状态时,</FONT><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>计数率为</FONT><FONT SIZE=2>fosc/12;</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>当工作于计数器状态时,</FONT><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>计数率为外部输入频率,此频率应小于</FONT><FONT SIZE=2>fosc/24</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>。产生溢出所需周期与定时器</FONT><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>的工作方式、</FONT><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>的预置值有关。</font></P>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>定时器</font><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>工作于方式</FONT><FONT SIZE=2>0</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>:溢出所需周期数</FONT><FONT SIZE=2>=8192-x </font>
</p>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>定时器</font><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>工作于方式</FONT><FONT SIZE=2>1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>:溢出所需周期数</FONT><FONT SIZE=2>=65536-x</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>定时器</font><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>工作于方式</FONT><FONT SIZE=2>2</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>:溢出所需周期数</FONT><FONT SIZE=2>=256-x</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>因为方式</font><FONT SIZE=2>2</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>为自动重装入初值的</FONT><FONT SIZE=2>8</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>位定时器</FONT><FONT SIZE=2>/</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>计数器模式,所以用它来做波特率发生器最恰当。</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>当时钟频率选用</font><FONT SIZE=2>11.0592MHZ</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>时,取易获得标准的波特率,所以很多单片机系统选用这个看起来“怪”的晶振就是这个道理。</font></P>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>下表列出了定时器</font><FONT SIZE=2>T1</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>工作于方式</FONT><FONT SIZE=2>2</FONT><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>常用波特率及初值。</font></P>
<TABLE BORDER CELLSPACING=1 CELLPADDING=7 WIDTH=592>
<TR><TD WIDTH="25%" VALIGN="TOP">
<FONT FACE="宋体" LANG="ZH-CN" SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">常用波特率</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">Fosc(MHZ)</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">SMOD</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<FONT SIZE=2>TH1</font><FONT FACE="宋体" LANG="ZH-CN" SIZE=2>初值</FONT></TD>
</TR>
<TR><TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">19200</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">11.0592</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">1</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">FDH</FONT></TD>
</TR>
<TR><TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">9600</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">11.0592</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">0</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">FDH</FONT></TD>
</TR>
<TR><TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">4800</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">11.0592</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">0</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">FAH</FONT></TD>
</TR>
<TR><TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">2400</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">11.0592</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">0</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">F4h</FONT></TD>
</TR>
<TR><TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">1200</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">11.0592</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">0</FONT></TD>
<TD WIDTH="25%" VALIGN="TOP">
<FONT SIZE=2>
<P ALIGN="JUSTIFY" style="line-height: 150%; margin-top: 0; margin-bottom: 0">E8h</FONT></TD>
</TR>
</TABLE>
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0"> </p>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -