⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zbcaich's blog.htm

📁 使用曼切斯特码作为无线传输的程序,希望大家多多支持啦!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
style="FONT: 7pt 'Times New Roman'">         
</SPAN></SPAN></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在电平变化中断后重赋定时器初值是为了抵消时间的累积误差。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以图为例进行说明:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=center><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><A 
href="zbcaich's Blog.files/79afcb82-a433-4d3a-8cdf-a084505e7afb.jpg" 
target=_blank><IMG height=142 alt=点击看大图 
src="zbcaich's Blog.files/79afcb82-a433-4d3a-8cdf-a084505e7afb.jpg" 
width=400></A></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=center><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><A 
href="http://blog.ednchina.com/Upload/Blog/2007/6/22/e4e957ed-b73b-418f-9eed-17a0c02b9603.JPG" 
target=_blank><A 
href="http://blog.ednchina.com/Upload/Blog/2007/6/25/235a7eae-ca08-4f30-bc01-8e8a2a04270d.JPG" 
target=_blank><A 
href="http://blog.ednchina.com/Upload/Blog/2007/6/25/235a7eae-ca08-4f30-bc01-8e8a2a04270d.JPG" 
target=_blank></A></A></A></SPAN></P><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">⑴ 在<SPAN 
lang=EN-US>a</SPAN>处产生中断,“预备……”;<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">⑵ 在</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">b</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处产生中断,“准备就绪”;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">⑶ 在</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">c</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处产生中断,“检查同步头中低电平宽度是否合法。</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">OK</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,则准备进入数据接收;否则仍就“</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体">预备……</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">””;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><v:line id=_x0000_s1028 
style="Z-INDEX: 3; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left; flip: x" 
from="18pt,-85.75pt" to="99pt,-85.75pt" coordsize="21600,21600"><v:stroke 
endarrow="block"></v:stroke></v:line><v:line id=_x0000_s1027 
style="Z-INDEX: 2; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left; flip: x" 
from="351pt,-179.35pt" to="378pt,-179.35pt" coordsize="21600,21600"><v:stroke 
endarrow="block"></v:stroke></v:line><v:line id=_x0000_s1026 
style="Z-INDEX: 1; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left; flip: x" 
from="261pt,-179.35pt" to="4in,-179.35pt" coordsize="21600,21600"><v:stroke 
endarrow="block"></v:stroke></v:line><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">⑷ ●在</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">d</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处(图上)或</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">e</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处(图下)产生中断,则判断是否产生了</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">2</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">次计时中断。很显然,对于图上只能产生</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">1</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">次计时中断,而图下就产生</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">2</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">次计时中断。产生了</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">2</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">次计时中断时,对数据进行判断,对于图下就能判断数据为</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">1</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。对于图上,由于不足</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">2</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">次计时中断,所以直接退出中断。等待下一次中断(图上</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">e</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处)。</SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0cm 0cm 0pt 39pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 39.0pt"><SPAN 
lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体"><SPAN 
style="mso-list: Ignore">●<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN></SPAN></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图上在</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">e</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处产生中断,很明显,计时中断数为</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">2</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,对数据进行判断,为</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">⑸ 对数据进行判断后即清计时中断计数器。即</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">Rfcount</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。为下一个数据接收作准备。返回到步骤⑷。如此反复,即可对所有的数据作出完整接收!</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">⑹ 由于以上接收时间为基准的,即</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">Rfcount</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">2</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">次计时中断。所以数据中的高电平和低电平都有计时,其中任何</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">1</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个的宽度超限都能导致接收失败。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"></SPAN>&nbsp;</P></DIV>
<DIV class=article_more>
<DIV class=article_more_left>
<TABLE>
  <TBODY>
  <TR>
    <TD class=article_more_left_title>系统分类:</TD>
    <TD class=article_more_left_value><A 
      href="http://blog.ednchina.com/10042/category.aspx">单片机 </A></TD></TR>
  <TR>
    <TD class=article_more_left_title>用户分类:</TD>
    <TD class=article_more_left_value>无分类 </TD></TR>
  <TR>
    <TD class=article_more_left_title>标签:</TD>
    <TD class=article_more_left_value><A title=中断 
      href="http://blog.ednchina.com/lable/&Ouml;&ETH;&para;&Iuml;.aspx">中断</A> <A title=脉冲宽度 
      href="http://blog.ednchina.com/lable/&Acirc;&ouml;&sup3;&aring;&iquest;í&para;&Egrave;.aspx">脉冲宽度</A> </TD></TR>
  <TR>
    <TD class=article_more_left_title>来源:</TD>
    <TD class=article_more_left_value>原创 </TD></TR></TBODY></TABLE></DIV>
<DIV class=article_more_right><A 
href="http://blog.ednchina.com/zbcaich/33332/message.aspx#feedback">发表评论</A> 
阅读全文(558) | 回复(0) </DIV></DIV></DIV></DIV>
<DIV class=article>
<DIV class=article_digg>
<DIV class=digg id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl03_Digg1>
<H4 id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl03_Digg1_display 
style="opacity: 1">1 </H4><SPAN class=unclicked onmouseover=Digg_Mouseover(this) 
onclick="if(this.className != 'clicked'){WebForm_DoCallback('ctl00$ctl00$SkinBody$Content$ContentControl$ctl03$Digg1',null,DiggClientCallBack,null,null,true)}" 
onmouseout=Digg_Mouseout(this)></SPAN></DIV><IMG 
id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl03_aboutvote alt=关于投票 
src="zbcaich's Blog.files/q.gif"> <BR></DIV>
<DIV style="MARGIN-LEFT: 100px">
<DIV class=article_title><A 
href="http://blog.ednchina.com/zbcaich/33239/message.aspx">无线遥控的曼彻斯特编码的接收 
</A></DIV>
<DIV class=article_info>发表于 2007-6-21 15:55:22 </DIV>
<DIV class=article_content>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" 
align=center><SPAN 
style="FONT-SIZE: 16pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">无线遥控的曼彻斯特编码的接收</SPAN><SPAN 
lang=EN-US style="FONT-SIZE: 16pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">市场上多用</SPAN><SPAN 
lang=EN-US>2262</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN 
lang=EN-US>1527</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">做发射,它们的发射格式如下:</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=center><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><A 
href="zbcaich's Blog.files/b48fc3fd-da0a-4e72-8f8b-f5ca9bfc0c54.jpg" 
target=_blank><IMG height=252 alt=点击看大图 
src="zbcaich's Blog.files/b48fc3fd-da0a-4e72-8f8b-f5ca9bfc0c54.jpg" 
width=400></A></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=center><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><A 
href="http://blog.ednchina.com/Upload/Blog/2007/6/21/595152ca-2a55-4386-9cbf-a1d1f20a3758.JPG" 
target=_blank></A></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><v:line id=_x0000_s1040 
style="Z-INDEX: 15; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left" 
from="225pt,0" to="261pt,0"></v:line><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">              &nbsp;&nbsp;&nbsp; 
图</SPAN><SPAN lang=EN-US>1</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">通常它们都是传送的</SPAN><SPAN 
lang=EN-US>24</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位数据,包括按键代码。在</SPAN><SPAN 
lang=EN-US>2262</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中只有</SPAN><SPAN 
lang=EN-US>12</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个输入端,它们是</SPAN><SPAN 
lang=EN-US>8</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个地址码加</SPAN><SPAN 
lang=EN-US>4</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个按键码,但由于地址码是</SPAN><SPAN 
lang=EN-US>3</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">态输入的,每一位要用</SPAN><SPAN 
lang=EN-US>2</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">个脉冲来表示,所以实际上它与</SPAN><SPAN 
lang=EN-US>1527</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN 
lang=EN-US>24</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位数据是一样的接收。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">由于在普通接收模块的传输速率不能做得很高,所以数据编码中脉冲宽度大都在</SPAN><SPAN 
lang=EN-US>300</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">-</SPAN><SPAN 
lang=EN-US>500us</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">左右,即上图中的</SPAN><SPAN 
lang=EN-US>a</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的宽度。它们要发射</SPAN><SPAN 
lang=EN-US>1</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">串完整的数据就要</SPAN><st1:chmetcnv 
UnitName="a" SourceValue="128" HasSpace="False" Negative="False" NumberType="1" 
TCSC="0" w:st="on"><SPAN lang=EN-US>128a</SPAN></st1:chmetcnv><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(</SPAN><SPAN 
lang=EN-US>38.4ms</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">-</SPAN><SPAN 
lang=EN-US>64ms</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)的时间。这还只是发送</SPAN><SPAN 
lang=EN-US>24</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位数据,如果用这种方式来发送</SPAN><SPAN 
lang=EN-US>64</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位乃至更多位数据时就得需要更多的时间。</SPAN></P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -