串口

MSP430_x2xx UART波特率设置方法

<p>&nbsp;对于给定的时钟源,波特率有分频因子决定</p>
<p><img alt="" src="http://www.benp366.com/download.asp?id=6" /></p>
<p style="TEXT-INDENT: 21pt" class="MsoNormal"><span style="FONT-SIZE: 12pt" lang="EN-US"><sub><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:preferrelative="t" o:spt="75" filled="f" stroked="f" path=" m@4@5 l@4@11@9@11@9@5 xe"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0 "></v:f><v:f eqn="sum @0 1 0 "></v:f><v:f eqn="sum 0 0 @1 "></v:f><v:f eqn="prod @2 1 2 "></v:f><v:f eqn="prod @3 21600 pixelWidth "></v:f><v:f eqn="prod @3 21600 pixelHeight "></v:f><v:f eqn="sum @0 0 1 "></v:f><v:f eqn="prod @6 1 2 "></v:f><v:f eqn="prod @7 21600 pixelWidth "></v:f><v:f eqn="sum @8 21600 0 "></v:f><v:f eqn="prod @7 21600 pixelHeight "></v:f><v:f eqn="sum @10 21600 0 "></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape style="WIDTH: 69.75pt; HEIGHT: 30.75pt" id="_x0000_i1025" o:ole="" type="#_x0000_t75" coordsize="21600,21600"><v:imagedata o:title="" src="MSP430_x2xx%20UART波特率设置方法.files/image001.wmz"></v:imagedata></v:shape></sub><o:p></o:p></span></p>
<p style="TEXT-INDENT: 21pt" class="MsoNormal"><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">很多情况下</span><span style="FONT-SIZE: 12pt" lang="EN-US">N</span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是非整数,所以使用分频器和调整器两部分来组成波特率发生器,这样是分频因子尽量接近需要值。分频器完成分频功能,调整器的数据按每一位计算,将对应为的数据(</span><span style="FONT-SIZE: 12pt" lang="EN-US">0</span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</span><span style="FONT-SIZE: 12pt" lang="EN-US">1</span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)加到每次分频计数器的<span class="GramE">分频值</span>上。</span><span style="FONT-SIZE: 12pt" lang="EN-US"><o:p></o:p></span></p>
<p style="TEXT-INDENT: 21pt" class="MsoNormal"><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">若</span><span style="FONT-SIZE: 12pt" lang="EN-US">N</span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">大于或等于</span><span style="FONT-SIZE: 12pt" lang="EN-US">16</span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,则可以通过设置</span><span style="FONT-SIZE: 12pt" lang="EN-US">UCOS16</span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来启动</span><span style="FONT-SIZE: 12pt" lang="EN-US"> <span class="SpellE">oversampling</span> baud rate generation mode </span><span style="FONT-FAMILY: 宋体; FONT-SIZE: 12pt; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span><span style="FONT-SIZE: 12pt" lang="EN-US"><o:p></o:p></span><span style="FONT-SIZE: 12pt" lang="EN-US"><font class="Apple-style-span" face="宋体"><br />
</font> <o:p></o:p></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="FONT-SIZE: 12pt" lang="EN-US"><o:p></o:p></span></p>