智能车制作

标题: 输入捕捉计数  PACN0出错!!!! [打印本页]

作者: xingxq2006    时间: 2008-5-12 02:57
标题: 输入捕捉计数  PACN0出错!!!!
< class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>void Init_ETC(void)</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCFLG_MCZF=1;</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCCTL_MODMC=1; //</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">循环计数</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCCTL_MCZI=1;</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCCTL_MCEN=1;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">模数计数器使能</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCCTL_MCPR=3;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">设置</SPAN><SPAN lang=EN-US>16</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">分频</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCCNT=64000;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">设置中断时间</SPAN><SPAN lang=EN-US>32ms</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>MCCTL_FLMC=1;</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>TIOS_IOS0=0;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">设置</SPAN><SPAN lang=EN-US>PT0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">输入捕捉</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>TCTL4=0x01;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">设置上沿捕捉</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT size=3>&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>PBCTL_PBEN=1;</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>} </FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-comffice:office" /><o:p><FONT size=3>&nbsp;</FONT></o:p></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>#pragma<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>CODE_SEG<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>NON_BANKED<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>void interrupt 26 speed_get(void)</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>{</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>MCFLG_MCZF=1;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">清中断标志</SPAN><SPAN lang=EN-US> </SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>V=PACN0;//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">读出脉冲计数值</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>PACN0=0;</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"><FONT size=3>&nbsp; </FONT></SPAN></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>.</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>.</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>.</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><FONT size=3>编译时出错:</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><FONT size=3>Link Error:symbol_fufloat in ……is undefined</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><FONT size=3></FONT></SPAN>&nbsp;</P>
作者: 920lyj    时间: 2008-5-20 17:56
标题: Re:输入捕捉计数  PACN0出错!!!!
ICPAR_PA0EN = 1;初始化少了这条
作者: 小手    时间: 2008-6-11 06:39
标题: Re:输入捕捉计数  PACN0出错!!!!
<STRONG>xingxq2006</STRONG><BR>您的程序调好了没有?能否说明一下怎么解决的?谢谢!




欢迎光临 智能车制作 (http://dns.znczz.com/) Powered by Discuz! X3.2