智能车制作

标题: 急急急!请教 [打印本页]

作者: supervictor    时间: 2008-5-11 05:07
标题: 急急急!请教
< class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><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:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-comffice:office" /><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_i1025 style="WIDTH: 400.5pt; HEIGHT: 312.75pt" type="#_x0000_t75"><v:imagedata cropright="25718f" cropbottom="14676f" croptop="1022f" o:title="" src="file:///C:&#92;DOCUME~1&#92;MINSTA~1.HFU&#92;LOCALS~1&#92;Temp&#92;msohtml1&#92;01&#92;clip_image001.png"></P><DIV style="OVERFLOW: auto; WIDTH: 100%">进入中段就出不来,我用的是输入捕捉行同步,中断标志位始终为1,向TFLG1_C1F写1,也清不了零,初始化将TSCR1_TFFCA=1,自动清零也清不了,请哪位能指点一下在下? </DIV><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"></v:imagedata></v:shape></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>void vECTInit(void)</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"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>TIOS =0x00;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//</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;</SPAN>TSCR1=0X80; </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>TSCR2=0x83;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">允许定时器溢出中断,定时器时钟</SPAN><?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:chmetcnv UnitName="m" SourceValue="32" HasSpace="False" Negative="False" NumberType="1" TCSC="0"><SPAN lang=EN-US>32M</SPAN></st1:chmetcnv><SPAN lang=EN-US>/(2^3)=</SPAN><st1:chmetcnv UnitName="m" SourceValue="4" HasSpace="False" Negative="False" NumberType="1" TCSC="0"><SPAN lang=EN-US>4M</SPAN></st1:chmetcnv></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>TCTL4=0xAA;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//</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><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; </SPAN>TIE<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>=0x07;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>//开中断</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>TFLG1=0xFF;</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;&nbsp;&nbsp; </SPAN>//</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></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3>} TSCR1_TFFCA=1;<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>// if set, TFLG1 can be cleared auto, manual clear is useless<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></P>
作者: whut_wj    时间: 2008-5-11 06:07
标题: Re:急急急!请教
<>看不出什么问题,进中断把中断使能关了.TIE<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>=0x00;</P><P>处理完了再开,试试.</P>
作者: supervictor    时间: 2008-5-14 06:10
标题: Re:急急急!请教
<>还是不行啊!我的思路是让输入捕捉2号通道捕捉行同步,1同道捕捉场同步,由于1通道中断优先级高,一但场同步信号来了就会打破行同步,进入场同步中断。但是进了场同步中断就跳不出离开,始终在场同步中断里,我用的是单步调试,是不是用单步调试的原因啊?谢谢!赐教一下啊!!急急急!</P>
作者: superyongzhe    时间: 2008-5-15 05:10
标题: Re:急急急!请教
不能单步调试
作者: supervictor    时间: 2008-5-15 05:29
标题: Re:急急急!请教
<>那应该怎样调试?</P>
作者: superyongzhe    时间: 2008-5-15 23:07
标题: Re:急急急!请教
我没有用过单步调试,不过我也是用输入捕捉来产生行场中断来采集数据的。最开始我也遇到过不能跳出中断的麻烦,在行场中断中首先要清除标志位,然后再写其他代码吧!由于行场信号是事实的,所以单步调试是不合适的!至于为什么自己想吧!




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