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

📄 第一届飞思卡尔智能车竞赛华中科技大学的程序清单 2_大学生参考网.mht

📁 飞思卡尔单片机mc9s12dg128的ad初始化参考程序
💻 MHT
📖 第 1 页 / 共 5 页
字号:
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">if</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">(</SPAN><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Direction</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">&lt;3000)=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Direction</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">=3D3000;=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">if</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">(</SPAN><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Direction</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">&gt;6000)=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Direction</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">=3D6000;=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">PWMPER01 =3D 60000;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/* =
Center=20
            1500ms*3 */ <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">PWMDTY01 =3D=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Direction</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">+93; =
</SPAN><SPAN=20
            lang=3DEN-US style=3D"COLOR: #009a00; FONT-FAMILY: 'Times =
New Roman'">/*=20
            </SPAN><SPAN=20
            style=3D"COLOR: #009a00; mso-bidi-font-family: 'Times New =
Roman'; mso-ascii-font-family: 'Times New Roman'"><FONT=20
            =
face=3D=BA=DA=CC=E5>=C9=E8=D6=C3=B6=E6=BB=FA=BD=C7=B6=C8</FONT></SPAN><SP=
AN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'"> */ =

            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">if</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">(</SPAN><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Velocity</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">&gt;24000)=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Velocity</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">=3D24000;=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">PWMPER45 =3D 24000;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/* =
1kHz (=20
            &lt;10kHz ) */ <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">PWMDTY45 =3D=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #7f7f7f; FONT-FAMILY: 'Times New =
Roman'">Velocity</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">; =
</SPAN><SPAN=20
            lang=3DEN-US style=3D"COLOR: #009a00; FONT-FAMILY: 'Times =
New Roman'">/*=20
            </SPAN><SPAN=20
            style=3D"COLOR: #009a00; mso-bidi-font-family: 'Times New =
Roman'; mso-ascii-font-family: 'Times New Roman'"><FONT=20
            =
face=3D=BA=DA=CC=E5>=C9=E8=D6=C3=B5=E7=BB=FA=CB=D9=B6=C8</FONT></SPAN><SP=
AN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'"> */ =

            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>}=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New =
Roman'"><FONT=20
            size=3D3>/* initiate Real Time Interrupt 1.0 */=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">void=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #870000; FONT-FAMILY: 'Times New =
Roman'">Init_INT_RTI</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">(</SPAN><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">void</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">)=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>{=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT =
size=3D3>RTICTL =3D 0x74;=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT =
size=3D3>CRGINT |=3D0x80;=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>}=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New =
Roman'"><FONT=20
            size=3D3>/* Real Time Interrupt 1.0 */ =
<o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">interrupt=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New Roman'">void=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #870000; FONT-FAMILY: 'Times New =
Roman'">INT_RTI</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">(</SPAN><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">void</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">)=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>{=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">CRGFLG =
|=3D 0x80;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/* =
clear the=20
            interrrupt flag */ <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>}=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New =
Roman'"><FONT=20
            size=3D3>/* INT_Timer0 initiate 1.0 */ =
<o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">void=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #870000; FONT-FAMILY: 'Times New =
Roman'">Init_INT_Timer</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">(</SPAN><SPAN=20
            lang=3DEN-US=20
            style=3D"COLOR: blue; FONT-FAMILY: 'Times New =
Roman'">void</SPAN><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">)=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>{=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">TSCR2 =
=3D0x07;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/* =
128Hz at=20
            <st1:chmetcnv TCSC=3D"0" NumberType=3D"1" Negative=3D"False" =

            HasSpace=3D"False" SourceValue=3D"16" UnitName=3D"m"=20
            w:st=3D"on">16M</st1:chmetcnv> bus clok */=20
            <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New =
Roman'"><FONT=20
            size=3D3>/* 128Hz * 2/3 at <st1:chmetcnv TCSC=3D"0" =
NumberType=3D"1"=20
            Negative=3D"False" HasSpace=3D"False" SourceValue=3D"24" =
UnitName=3D"m"=20
            w:st=3D"on">24m</st1:chmetcnv> bus clock */=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New =
Roman'"><FONT=20
            size=3D3>/* in fact it is a little more than it. */=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">TIOS =
|=3D0x01;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/* =
I/O select=20
            */ <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New Roman'">TIE =
|=3D0x01;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/* =
Interrupt=20
            Enable */ <o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><FONT =
size=3D3><SPAN=20
            lang=3DEN-US style=3D"FONT-FAMILY: 'Times New =
Roman'">TSCR1|=3D0x80;=20
            </SPAN><SPAN lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New Roman'">/*=20
            TSCR1_TEN=3D1 //Timer Enable */ =
<o:p></o:p></SPAN></FONT></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"FONT-FAMILY: 'Times New Roman'"><FONT size=3D3>}=20
            <o:p></o:p></FONT></SPAN></P>
            <P class=3DDefault style=3D"MARGIN: 0cm 0cm 0pt"><SPAN =
lang=3DEN-US=20
            style=3D"COLOR: #009a00; FONT-FAMILY: 'Times New =
Roman'"><FONT=20
            size=3D3>/* INT_Timer0 1.

⌨️ 快捷键说明

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