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

📄 zbcaich's blog.htm

📁 使用曼切斯特码作为无线传输的程序,希望大家多多支持啦!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<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>MICROCHIP</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/092fbc8a-1b87-4cb2-8940-906584721433.jpg" 
target=_blank><IMG height=284 alt=点击看大图 
src="zbcaich's Blog.files/092fbc8a-1b87-4cb2-8940-906584721433.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/5d14ec6b-6bac-4cb3-8ce5-6002cc45f55d.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_s1053 
style="Z-INDEX: 28; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left" 
from="189pt,0" to="225pt,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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
图</SPAN><SPAN lang=EN-US>2</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><v:line id=_x0000_s1048 
style="Z-INDEX: 23; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left" 
from="199.5pt,474.15pt" to="235.5pt,474.15pt"></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>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="1" HasSpace="False" Negative="False" NumberType="1" 
TCSC="0" w:st="on"><SPAN lang=EN-US>1a</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>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="225" HasSpace="False" Negative="False" NumberType="1" 
TCSC="0" w:st="on"><SPAN lang=EN-US>225a</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>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>100</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">-</SPAN><SPAN 
lang=EN-US>400us</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,所以整串数据的时间是</SPAN><SPAN 
lang=EN-US>27</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">-</SPAN><SPAN 
lang=EN-US>108ms</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>72</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位数据,在接收上仍然使用了较廉价的超再生接收电路,为了尽可能的减少丢码等接收不全的现像,发送方面采用了较宽的脉冲宽度(</SPAN><SPAN 
lang=EN-US>300us</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 
lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><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></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/83b334f7-debf-4844-8a23-da76468cbe7d.jpg" 
target=_blank><IMG height=152 alt=点击看大图 
src="zbcaich's Blog.files/83b334f7-debf-4844-8a23-da76468cbe7d.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/f10d49d6-e822-4e6a-80fa-5906b97ffabf.JPG" 
target=_blank></A></SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 84pt; mso-char-indent-count: 8.0">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
lang=EN-US></SPAN></P><v:line id=_x0000_s1066 
style="Z-INDEX: 41; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left" 
from="270pt,0" to="306pt,0"></v:line><v:line id=_x0000_s1065 
style="Z-INDEX: 40; LEFT: 0px; POSITION: absolute; TEXT-ALIGN: left" 
from="126pt,0" to="162pt,0"></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>3</SPAN> 
<P></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><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>MCU</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"><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/26/55c47da1-d1cd-4921-bd95-eb7675134064.rar" 
target=_blank><IMG alt=rar src="zbcaich's Blog.files/rar.gif"></A></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US></SPAN></P><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">以上程序经过测试,是完全可以对曼彻斯特编码作完整接收的。</SPAN>
<P></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 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN 
lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN 
style="mso-list: Ignore">1<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&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>MPLAB</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"> </SPAN><SPAN 
lang=EN-US>IDE7.40</SPAN></P>
<P class=MsoNormal 
style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN 
lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN 
style="mso-list: Ignore">2<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&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>0</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 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN 
lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN 
style="mso-list: Ignore">3<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&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><st1:chmetcnv 
UnitName="m" SourceValue="4" HasSpace="False" Negative="False" NumberType="1" 
TCSC="0" w:st="on"><SPAN lang=EN-US>4M</SPAN></st1:chmetcnv></P>
<P class=MsoNormal 
style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN 
lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN 
style="mso-list: Ignore">4<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&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>300us</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 
lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P>&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/&Acirc;ü&sup3;&sup1;&Euml;&sup1;&Igrave;&Oslash;.aspx">曼彻斯特</A> <A title=滚动码 
      href="http://blog.ednchina.com/lable/&sup1;&ouml;&para;&macr;&Acirc;&euml;.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/33239/message.aspx#feedback">发表评论</A> 
阅读全文(550) | 回复(0) </DIV></DIV></DIV></DIV>
<DIV class=article>
<DIV class=article_digg>
<DIV class=digg id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl04_Digg1>
<H4 id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl04_Digg1_display 
style="opacity: 1">4 </H4><SPAN class=unclicked onmouseover=Digg_Mouseover(this) 
onclick="if(this.className != 'clicked'){WebForm_DoCallback('ctl00$ctl00$SkinBody$Content$ContentControl$ctl04$Digg1',null,DiggClientCallBack,null,null,true)}" 
onmouseout=Digg_Mouseout(this)></SPAN></DIV><IMG 
id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl04_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/32252/message.aspx">基于单片机的无线遥控系统 
</A></DIV>
<DIV class=article_info>发表于 2007-6-12 22:34:27 </DIV>
<DIV class=article_content>
<P>  目前市面上的无线遥控系统多采用专用编码器电路,固定码的有2262,1527等,它们的应用电路大都是用按键控制编码器的电源(直接或间接),当按下按键时就接通编码器的电源供电,编码器得电而工作。</P>
<P>  鉴于现下的单片机的功耗是越做越低,体积也越来越小,其休眠电流已可以做到1uA以下,用它来做无线遥控系统中发射编电路以成为可能。在用单片机做发射时,采用3-3.6伏直接供电,用按键接其I/O口于地,打开单片机的弱上拉功能,其硬件设计会大大简化。在软件上设计上,平时没键按下的时候单片机处于休眠状态,有按键按下时就唤醒单片机,单片机就按特定的算法发出数据编码,发完后检测按键是否放开,没放开继续发射,否则就又进入睡眠状态,以保持其低功耗。</P>
<P>  在数据编码时,可以进行简单的CRC校验,也可以用保密性很高的滚动码算法,使用软件来做滚动码算法的优点是软硬件都由自己把握,设计余量很大并且没有一般的滚动码的漏洞存在!</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>无标签 </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/32252/message.aspx#feedback">发表评论</A> 
阅读全文(809) | 回复(0) </DIV></DIV></DIV></DIV>
<DIV class=article>
<DIV class=article_digg>
<DIV class=digg id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl05_Di

⌨️ 快捷键说明

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