<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>纪小年 &#187; 电子设计</title>
	<atom:link href="http://xnian.com/tag/%e7%94%b5%e5%ad%90%e8%ae%be%e8%ae%a1/feed" rel="self" type="application/rss+xml" />
	<link>http://xnian.com</link>
	<description>人生的意义在于奉献</description>
	<lastBuildDate>Sun, 04 Apr 2010 03:32:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>晶体管收音机用中频变压器数据</title>
		<link>http://xnian.com/2009/07/1676.html</link>
		<comments>http://xnian.com/2009/07/1676.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 11:22:57 +0000</pubDate>
		<dc:creator>纪小年</dc:creator>
				<category><![CDATA[电子设计]]></category>
		<category><![CDATA[中周]]></category>
		<category><![CDATA[中频变压器]]></category>
		<category><![CDATA[震荡线圈]]></category>

		<guid isPermaLink="false">http://xnian.com/?p=1676</guid>
		<description><![CDATA[晶体管收音机中使用的中频变压器数据① 型号 中频频率 (kHz) 初级圈数 次级圈数 使用导线(mm) 选择性 (±10kHz) (dB) 在谐振水平70%的通频带 (kHz) 可调频率范围 (kHz) 灵敏度 (mV) 中频Q值 并联回路电容 (pF) 顶部色标 体积尺寸 (mm3) TTF-1-1 465±2 49+171 13 QA φ0.07 ≥6 ≥7.5 455-475 150-180 ≥80 140 (内附) 白 7×7×12 TTF-1-2 46+172 9 ≥6 ≥7.5 220-250 红 TTF-1-3 33+187 14 ≥6.5 ≥6.5 90-130 绿 TTF-2-1 465±2 45+117 7 [...]]]></description>
			<content:encoded><![CDATA[<p align="center">晶体管收音机中使用的中频变压器数据①</p>
<table border="1" cellspacing="0" cellpadding="0" width="620" align="center">
<colgroup><font size="1"><br />
<col width="77" />
<col width="72" />
<col width="92" />
<col width="72" />
<col width="39" />
<col width="83" /></font></colgroup>
<tbody>
<tr>
<td valign="middle" width="55" align="center"><font size="1">型号</font></td>
<td valign="middle" width="48" align="center"><font size="1">中频频率            <br />(kHz)</font></td>
<td valign="middle" width="49" align="center"><font size="1">初级圈数</font></td>
<td valign="middle" width="25" align="center"><font size="1">次级圈数</font></td>
<td valign="middle" width="44" align="center"><font size="1">使用导线(mm)</font></td>
<td valign="middle" width="52" align="center"><font size="1">选择性            <br />(±10kHz)             <br />(dB)</font></td>
<td valign="middle" width="50" align="center"><font size="1">在谐振水平70%的通频带            <br />(kHz)</font></td>
<td valign="middle" width="49" align="center"><font size="1">可调频率范围            <br />(kHz)</font></td>
<td valign="middle" width="52" align="center"><font size="1">灵敏度            <br />(mV)</font></td>
<td valign="middle" width="46" align="center"><font size="1">中频Q值</font></td>
<td valign="middle" width="38" align="center"><font size="1">并联回路电容            <br />(pF)</font></td>
<td valign="middle" width="26" align="center"><font size="1">顶部色标</font></td>
<td valign="middle" width="58" align="center"><font size="1">体积尺寸            <br />(mm3)</font></td>
</tr>
<tr>
<td><font size="1">TTF-1-1</font></td>
<td valign="middle" rowspan="3" align="center"><font size="1">465±2</font></td>
<td valign="middle" align="center"><font size="1">49+171</font></td>
<td valign="middle" align="center"><font size="1">13</font></td>
<td valign="middle" rowspan="3" width="44" align="center"><font size="1">QA            <br />φ0.07</font></td>
<td valign="middle" align="center"><font size="1">≥6</font></td>
<td valign="middle" align="center"><font size="1">≥7.5</font></td>
<td valign="middle" rowspan="3" align="center"><font size="1">455-475</font></td>
<td valign="middle" align="center"><font size="1">150-180</font></td>
<td valign="middle" rowspan="3" align="center"><font size="1">≥80</font></td>
<td valign="middle" rowspan="3" width="38" align="center"><font size="1">140            <br />(内附)</font></td>
<td valign="middle" align="center"><font size="1">白</font></td>
<td valign="middle" rowspan="3" align="center"><font size="1">7×7×12</font></td>
</tr>
<tr>
<td><font size="1">TTF-1-2</font></td>
<td valign="middle" align="center"><font size="1">46+172</font></td>
<td valign="middle" align="center"><font size="1">9</font></td>
<td valign="middle" align="center"><font size="1">≥6</font></td>
<td valign="middle" align="center"><font size="1">≥7.5</font></td>
<td valign="middle" align="center"><font size="1">220-250</font></td>
<td valign="middle" align="center"><font size="1">红</font></td>
</tr>
<tr>
<td><font size="1">TTF-1-3</font></td>
<td valign="middle" align="center"><font size="1">33+187</font></td>
<td valign="middle" align="center"><font size="1">14</font></td>
<td valign="middle" align="center"><font size="1">≥6.5</font></td>
<td valign="middle" align="center"><font size="1">≥6.5</font></td>
<td valign="middle" align="center"><font size="1">90-130</font></td>
<td valign="middle" align="center"><font size="1">绿</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-1</font></td>
<td valign="middle" rowspan="7" align="center"><font size="1">465±2</font></td>
<td valign="middle" align="center"><font size="1">45+117</font></td>
<td valign="middle" align="center"><font size="1">7</font></td>
<td valign="middle" rowspan="7" width="44" align="center"><font size="1">QA            <br />φ0.08</font></td>
<td valign="middle" align="center"><font size="1">≥7</font></td>
<td valign="middle" align="center"><font size="1">≥6.5</font></td>
<td valign="middle" rowspan="7" align="center"><font size="1">455-475</font></td>
<td valign="middle" align="center"><font size="1">220-260</font></td>
<td valign="middle" rowspan="7" align="center"><font size="1">80-100</font></td>
<td valign="middle" rowspan="7" align="center"><font size="1">200</font></td>
<td valign="middle" align="center"><font size="1">白</font></td>
<td valign="middle" rowspan="7" align="center"><font size="1">10×10×14</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-2</font></td>
<td valign="middle" align="center"><font size="1">45+117</font></td>
<td valign="middle" align="center"><font size="1">10</font></td>
<td valign="middle" align="center"><font size="1">≥5.5</font></td>
<td valign="middle" align="center"><font size="1">≥8</font></td>
<td valign="middle" align="center"><font size="1">180-220</font></td>
<td valign="middle" align="center"><font size="1">红</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-3</font></td>
<td valign="middle" align="center"><font size="1">46+116</font></td>
<td valign="middle" align="center"><font size="1">13</font></td>
<td valign="middle" align="center"><font size="1">≥6.5</font></td>
<td valign="middle" align="center"><font size="1">≥7.5</font></td>
<td valign="middle" align="center"><font size="1">110-150</font></td>
<td valign="middle" align="center"><font size="1">绿</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-4</font></td>
<td valign="middle" align="center"><font size="1">28+134</font></td>
<td valign="middle" align="center"><font size="1">8</font></td>
<td valign="middle" align="center"><font size="1">≥8</font></td>
<td valign="middle" align="center"><font size="1">≥5</font></td>
<td valign="middle" align="center"><font size="1">280-320</font></td>
<td valign="middle" align="center"><font size="1">白</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-5</font></td>
<td valign="middle" align="center"><font size="1">35+127</font></td>
<td valign="middle" align="center"><font size="1">8</font></td>
<td valign="middle" align="center"><font size="1">≥7</font></td>
<td valign="middle" align="center"><font size="1">≥6.5</font></td>
<td valign="middle" align="center"><font size="1">220-260</font></td>
<td valign="middle" align="center"><font size="1">红</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-6</font></td>
<td valign="middle" align="center"><font size="1">60+102</font></td>
<td valign="middle" align="center"><font size="1">22</font></td>
<td valign="middle" align="center"><font size="1">≥3</font></td>
<td valign="middle" align="center"><font size="1">≥10</font></td>
<td valign="middle" align="center"><font size="1">80-120</font></td>
<td valign="middle" align="center"><font size="1">绿</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-9</font></td>
<td valign="middle" align="center"><font size="1">48+114</font></td>
<td valign="middle" align="center"><font size="1">25</font></td>
<td valign="middle" align="center"><font size="1">≥2</font></td>
<td valign="middle" align="center"><font size="1">≥11.5</font></td>
<td valign="middle" align="center"><font size="1">100-140</font></td>
<td valign="middle" align="center"><font size="1">绿</font></td>
</tr>
<tr>
<td><font size="1">TTF-3-1</font></td>
<td valign="middle" rowspan="4" align="center"><font size="1">465±2</font></td>
<td valign="middle" align="center"><font size="1">36+129</font></td>
<td valign="middle" align="center"><font size="1">6</font></td>
<td valign="middle" rowspan="4" width="44" align="center"><font size="1">QA            <br />φ0.08</font></td>
<td valign="middle" align="center"><font size="1">9</font></td>
<td valign="middle" align="center"><font size="1">≥5.5</font></td>
<td valign="middle" rowspan="4" align="center"><font size="1">455-475</font></td>
<td valign="middle" align="center"><font size="1">275-315</font></td>
<td valign="middle" rowspan="4" align="center"><font size="1">80-120</font></td>
<td valign="middle" rowspan="4" align="center"><font size="1">200</font></td>
<td valign="middle" align="center"><font size="1">白</font></td>
<td valign="middle" rowspan="4" align="center"><font size="1">12×12×16</font></td>
</tr>
<tr>
<td><font size="1">TTF-3-2</font></td>
<td valign="middle" align="center"><font size="1">48+117</font></td>
<td valign="middle" align="center"><font size="1">6</font></td>
<td valign="middle" align="center"><font size="1">≥8</font></td>
<td valign="middle" align="center"><font size="1">≥6.5</font></td>
<td valign="middle" align="center"><font size="1">250-290</font></td>
<td valign="middle" align="center"><font size="1">红</font></td>
</tr>
<tr>
<td><font size="1">TTF-3-3</font></td>
<td valign="middle" align="center"><font size="1">46+119</font></td>
<td valign="middle" align="center"><font size="1">13</font></td>
<td valign="middle" align="center"><font size="1">≥7</font></td>
<td valign="middle" align="center"><font size="1">≥7.5</font></td>
<td valign="middle" align="center"><font size="1">140-180</font></td>
<td valign="middle" align="center"><font size="1">绿</font></td>
</tr>
<tr>
<td><font size="1">TTF-3-4</font></td>
<td valign="middle" align="center"><font size="1">46+119</font></td>
<td valign="middle" align="center"><font size="1">24</font></td>
<td valign="middle" align="center"><font size="1">≥4</font></td>
<td valign="middle" align="center"><font size="1">≥11.5</font></td>
<td valign="middle" align="center"><font size="1">100-140</font></td>
<td valign="middle" align="center"><font size="1">黄</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-7②</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">465±2</font></td>
<td valign="middle" align="center"><font size="1">50+70</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1"></font></td>
<td valign="middle" rowspan="2" width="44" align="center"><font size="1">QA            <br />φ0.08</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">≥14</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">≥5.5</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">455-475</font></td>
<td valign="middle" rowspan="2" width="52" align="center"><font size="1">230-270            <br />(Co=8pF)</font></td>
<td valign="middle" align="center"><font size="1">105-145</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">330</font></td>
<td valign="middle" align="center"><font size="1">白</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">10×10×14</font></td>
</tr>
<tr>
<td><font size="1">TTF-2-8②</font></td>
<td valign="middle" align="center"><font size="1">7+113</font></td>
<td valign="middle" align="center"><font size="1">110-160</font></td>
<td valign="middle" align="center"><font size="1">黄</font></td>
</tr>
</tbody>
</table>
<p><font size="1">注：     <br />①使用Mx-400锰锌铁氧体，工行磁芯外套磁帽。先绕次级，后绕初级。      <br />②TTF-2-7及TTF-2-8为电容耦合双调谐中频变压器，两只并结，耦合电容（6~8pF）外接在TTF-2-7的5（1）与TTF-2-8的2（3）脚间。</font></p>
<p align="center">晶体管收音机使用的震荡线圈数据</p>
<table border="1" cellspacing="0" cellpadding="0" width="620" align="center">
<colgroup><font size="1"><br />
<col width="77" />
<col width="95" />
<col span="span" width="72" />
<col width="92" />
<col span="span" width="72" />
<col width="65" /></font></colgroup>
<tbody>
<tr>
<td valign="middle" width="48" align="center"><font size="1">型号</font></td>
<td valign="middle" width="55" align="center"><font size="1">接收频率范围           <br />(MHz)</font></td>
<td valign="middle" width="73" align="center"><font size="1">初级圈数</font></td>
<td valign="middle" width="49" align="center"><font size="1">次级圈数</font></td>
<td valign="middle" width="52" align="center"><font size="1">使用导线           <br />（mm）</font></td>
<td valign="middle" width="56" align="center"><font size="1">电感可调范围           <br />(uH)</font></td>
<td valign="middle" width="30" align="center"><font size="1">Q值</font></td>
<td valign="middle" width="51" align="center"><font size="1">应用可变电容器           <br />(pF)</font></td>
<td valign="middle" width="39" align="center"><font size="1">整机电源电压           <br />(V)</font></td>
<td valign="middle" width="60" align="center"><font size="1">变频方式</font></td>
<td valign="middle" width="25" align="center"><font size="1">顶部色标</font></td>
<td valign="middle" width="56" align="center"><font size="1">体积尺寸           <br />（mm3）</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">LTF-1-1</font></td>
<td valign="middle" align="center"><font size="1">0.535-1.605</font></td>
<td valign="middle" align="center"><font size="1">144+8.5</font></td>
<td valign="middle" align="center"><font size="1">11.5</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.08</font></td>
<td valign="middle" align="center"><font size="1">340-420</font></td>
<td valign="middle" align="center"><font size="1">≥55</font></td>
<td valign="middle" align="center"><font size="1">3.5/60</font></td>
<td valign="middle" align="center"><font size="1">9</font></td>
<td valign="middle" align="center"><font size="1">自激式基极注入式</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
<td valign="middle" align="center"><font size="1">7×7×12</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">LTF-2-1</font></td>
<td valign="middle" align="center"><font size="1">0.535-1.605</font></td>
<td valign="middle" align="center"><font size="1">8+41.5+36.5</font></td>
<td valign="middle" align="center"><font size="1">2</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.08</font></td>
<td valign="middle" align="center"><font size="1">130-160</font></td>
<td valign="middle" align="center"><font size="1">≥70</font></td>
<td valign="middle" align="center"><font size="1">7/270</font></td>
<td valign="middle" align="center"><font size="1">6</font></td>
<td valign="middle" align="center"><font size="1">他激式</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">10×10×14</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">LTF-2-3</font></td>
<td valign="middle" align="center"><font size="1">0.535-1.605</font></td>
<td valign="middle" align="center"><font size="1">4.5+82</font></td>
<td valign="middle" align="center"><font size="1">8</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.08</font></td>
<td valign="middle" align="center"><font size="1">150-190</font></td>
<td valign="middle" align="center"><font size="1">≥70</font></td>
<td valign="middle" align="center"><font size="1">7/270</font></td>
<td valign="middle" align="center"><font size="1">4.5/6</font></td>
<td valign="middle" align="center"><font size="1">自激式发射极注入式</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">LTF-3-1</font></td>
<td valign="middle" align="center"><font size="1">0.535-1.605</font></td>
<td valign="middle" align="center"><font size="1">84.5+1.5</font></td>
<td valign="middle" align="center"><font size="1">8.5</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.08</font></td>
<td valign="middle" align="center"><font size="1">160-190</font></td>
<td valign="middle" align="center"><font size="1">≥70</font></td>
<td valign="middle" align="center"><font size="1">7/270</font></td>
<td valign="middle" align="center"><font size="1">6</font></td>
<td valign="middle" align="center"><font size="1">自激式发射极注入式</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
<td valign="middle" rowspan="2" align="center"><font size="1">12×12×16</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">SLTF-3-2</font></td>
<td valign="middle" align="center"><font size="1">3.9-18</font></td>
<td valign="middle" align="center"><font size="1">2+15</font></td>
<td valign="middle" align="center"><font size="1">7</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.17</font></td>
<td valign="middle" align="center"><font size="1">3.57-4.83</font></td>
<td valign="middle" align="center"><font size="1">≥30</font></td>
<td valign="middle" align="center"><font size="1">7/270</font></td>
<td valign="middle" align="center"><font size="1">6</font></td>
<td valign="middle" align="center"><font size="1">自激式发射极注入式</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">LS 122</font></td>
<td valign="middle" align="center"><font size="1">4.0-12</font></td>
<td valign="middle" align="center"><font size="1">34+3</font></td>
<td valign="middle" align="center"><font size="1">10</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.08</font></td>
<td valign="middle" align="center"><font size="1">19.4-22.4</font></td>
<td valign="middle" align="center"><font size="1">/</font></td>
<td valign="middle" align="center"><font size="1">7/270</font></td>
<td valign="middle" align="center"><font size="1">/</font></td>
<td valign="middle" align="center"><font size="1">自激式发射极注入式</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
<td valign="middle" align="center"><font size="1">10×10×14</font></td>
</tr>
<tr>
<td valign="middle"><font size="1">LTA-3-2</font></td>
<td valign="middle" align="center"><font size="1">中波天线线圈</font></td>
<td valign="middle" align="center"><font size="1">120+7</font></td>
<td valign="middle" align="center"><font size="1">5</font></td>
<td valign="middle" align="center"><font size="1">QAφ0.08</font></td>
<td valign="middle" align="center"><font size="1">≥380</font></td>
<td valign="middle" align="center"><font size="1">≥70</font></td>
<td valign="middle" align="center"><font size="1">/</font></td>
<td valign="middle" align="center"><font size="1">/</font></td>
<td valign="middle" align="center"><font size="1">/</font></td>
<td valign="middle" align="center"><font size="1">黑</font></td>
<td valign="middle" align="center"><font size="1">12×12×16</font></td>
</tr>
</tbody>
</table>
<p><font size="1"></font></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image11.png" width="411" height="380" /> </p>
<p>资料来源：矿石收音机</p>
]]></content:encoded>
			<wfw:commentRss>http://xnian.com/2009/07/1676.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>TEA2025 双通道音频功率放大电路</title>
		<link>http://xnian.com/2009/07/1674.html</link>
		<comments>http://xnian.com/2009/07/1674.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 09:29:06 +0000</pubDate>
		<dc:creator>纪小年</dc:creator>
				<category><![CDATA[电子设计]]></category>
		<category><![CDATA[音频功放]]></category>

		<guid isPermaLink="false">http://xnian.com/?p=1674</guid>
		<description><![CDATA[概述： TEA2025为立体声音频功率放大集成电路，适用于各类袖珍或便携式立体声收录机中作功率放放大器。采用DIP16封装形式。 特点： • 适用于双路对称式或BTL式连接 • 外接元件少 • 通道分离性好 • 电源电压范围宽（3V~12V） • 关机时无啸声 • 最大电压增益45dB（可通过外接电阻调节） • 软限幅 • 温度保护 • 3V的低压下可正常使用。 封装外形图 单位: mm 功能框图(左)管脚排列图(右)： 引出端功能符号： 序号 功 能 符 号 序号 功 能 符 号 1 BTL辅助 AUXBTL 9 地 GND 2 2通道输出 2OUT 10 1通道输入 1IN 3 2通道自举 2BS 11 1通道反馈 1FB 4 [...]]]></description>
			<content:encoded><![CDATA[<p>概述：</p>
<p>TEA2025为立体声音频功率放大集成电路，适用于各类袖珍或便携式立体声收录机中作功率放放大器。采用DIP16封装形式。</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://xnian.com/wp-content/uploads/2009/07/image6.png" width="227" height="240" /> 特点：</p>
<blockquote><p>• 适用于双路对称式或BTL式连接      <br />• 外接元件少       <br />• 通道分离性好       <br />• 电源电压范围宽（3V~12V）       <br />• 关机时无啸声       <br />• 最大电压增益45dB（可通过外接电阻调节）       <br />• 软限幅       <br />• 温度保护       <br />• 3V的低压下可正常使用。</p>
</blockquote>
<p align="right">封装外形图 单位: mm</p>
<p>功能框图(左)管脚排列图(右)：</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image7.png" width="600" height="268" /> </p>
</p>
<p>引出端功能符号：</p>
<table border="1" cellspacing="0" cellpadding="0" width="499">
<tbody>
<tr>
<td width="66">序号 </td>
<td width="101">功 能 </td>
<td width="92">符 号 </td>
<td width="63">序号 </td>
<td width="95">功 能 </td>
<td width="80">符 号</td>
</tr>
<tr>
<td width="66">1 </td>
<td width="101">BTL辅助 </td>
<td width="92">AUXBTL </td>
<td width="63">9 </td>
<td width="95">地 </td>
<td width="80">GND</td>
</tr>
<tr>
<td width="66">2 </td>
<td width="101">2通道输出 </td>
<td width="92">2OUT </td>
<td width="63">10 </td>
<td width="95">1通道输入 </td>
<td width="80">1IN </td>
</tr>
<tr>
<td width="66">3 </td>
<td width="101">2通道自举 </td>
<td width="92">2BS </td>
<td width="63">11 </td>
<td width="95">1通道反馈 </td>
<td width="80">1FB </td>
</tr>
<tr>
<td width="66">4 </td>
<td width="101">2通道功放地 </td>
<td width="92">2GNDp </td>
<td width="63">12 </td>
<td width="95">1通道功放地 </td>
<td width="80">1GNDp</td>
</tr>
<tr>
<td width="66">5 </td>
<td width="101">2通道功放地 </td>
<td width="92">2GNDp </td>
<td width="63">13 </td>
<td width="95">1通道功放地 </td>
<td width="80">1GNDp</td>
</tr>
<tr>
<td width="66">6 </td>
<td width="101">2通道反馈 </td>
<td width="92">2FB </td>
<td width="63">14 </td>
<td width="95">1通道自举 </td>
<td width="80">1BS </td>
</tr>
<tr>
<td width="66">7 </td>
<td width="101">2通道输入 </td>
<td width="92">2IN </td>
<td width="63">15 </td>
<td width="95">1通道输出 </td>
<td width="80">1OUT</td>
</tr>
<tr>
<td width="66">8 </td>
<td width="101">滤 波 </td>
<td width="92">FIL </td>
<td width="63">16 </td>
<td width="95">电 源 </td>
<td width="80">Vcc</td>
</tr>
</tbody>
</table>
<p>极限值：（绝对最大额定值，若无其它规定，Tamb=25℃）</p>
<table border="1" cellspacing="0" cellpadding="0" width="501">
<tbody>
<tr>
<td width="124">参数名称</td>
<td width="77">符号</td>
<td width="102">数值最小</td>
<td width="113">数值最大</td>
<td width="83">单位</td>
</tr>
<tr>
<td width="124">电源电压</td>
<td width="77">Vcc</td>
<td width="102">-</td>
<td width="113">15</td>
<td width="83">V</td>
</tr>
<tr>
<td width="124">输出峰值电流</td>
<td width="77">Iop</td>
<td width="102">-</td>
<td width="113">1.5</td>
<td width="83">A</td>
</tr>
<tr>
<td width="124">结温</td>
<td width="77">Tj</td>
<td width="102">&#160;</td>
<td width="113">150</td>
<td width="83">℃</td>
</tr>
<tr>
<td width="124">贮存温度</td>
<td width="77">Ts</td>
<td width="119">-40</td>
<td width="141">150</td>
<td width="112">℃</td>
</tr>
</tbody>
</table>
<p>电特性：（若无其它规定，Tamb=25℃,Vcc=9V，RL=8Ω，f=1KHz 。每一通道）</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image8.png" width="532" height="415" /> </p>
<p>测试与应用线路图：</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image9.png" width="484" height="279" /> </p>
<p align="center">（一） 双通道应用</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image10.png" width="512" height="255" /> </p>
<p align="center">（二） 桥式应用</p>
]]></content:encoded>
			<wfw:commentRss>http://xnian.com/2009/07/1674.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>12864液晶显示器(ST7920)基本显示程序(串口)</title>
		<link>http://xnian.com/2009/07/1598.html</link>
		<comments>http://xnian.com/2009/07/1598.html#comments</comments>
		<pubDate>Thu, 09 Jul 2009 14:06:20 +0000</pubDate>
		<dc:creator>纪小年</dc:creator>
				<category><![CDATA[单片机]]></category>
		<category><![CDATA[电子设计]]></category>
		<category><![CDATA[C语言]]></category>
		<category><![CDATA[程序]]></category>

		<guid isPermaLink="false">http://xnian.com/?p=1598</guid>
		<description><![CDATA[其实学校实验室里对每一组都发了一块12864供同学们使用，那个液晶显示器用的是6963的控制器。在网上找了半天也没找到相对应的PDF资料，一怒之下我就买了块ST7920控制的12864。今天把他的基本显示程序搞出来了，拿来秀一下…… 哦，我先把我这个12864的20个引脚简单的说一下吧，省的同学们找错程序。 管脚号 管脚名称 电平 管脚功能描述 1 VSS 0V 电源地 2 VCC 3.0+5V 电源正 3 V0 &#8211; 对比度（亮度）调整 4 RS(CS） H/L RS=“H”,表示DB7——DB0为显示数据 RS=“L”,表示DB7——DB0为显示指令数据 5 R/W(SID) H/L R/W=“H”,E=“H”,数据被读到DB7——DB0 R/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR 6 E(SCLK) H/L 使能信号 7 DB0 H/L 三态数据线 8 DB1 H/L 三态数据线 9 DB2 H/L 三态数据线 10 DB3 H/L 三态数据线 11 DB4 H/L 三态数据线 12 DB5 [...]]]></description>
			<content:encoded><![CDATA[<p>其实学校实验室里对每一组都发了一块12864供同学们使用，那个液晶显示器用的是6963的控制器。在网上找了半天也没找到相对应的PDF资料，一怒之下我就买了块ST7920控制的12864。今天把他的基本显示程序搞出来了，拿来秀一下……</p>
<p>哦，我先把我这个12864的<strong>20个引脚</strong>简单的说一下吧，省的同学们找错程序。</p>
<div align="center">
<table border="1" cellspacing="0" cellpadding="0" width="619" align="center">
<tbody>
<tr>
<td width="70" height="22" valign="top">           管脚号         </td>
<td width="85" height="22" valign="top">           管脚名称         </td>
<td width="79" height="22" valign="top">           电平         </td>
<td width="375" height="22" valign="top">           管脚功能描述         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           1         </td>
<td width="85" height="22" valign="top">           VSS         </td>
<td width="79" height="22" valign="top">           0V         </td>
<td width="375" height="22" valign="top">           电源地         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           2         </td>
<td width="85" height="22" valign="top">           VCC         </td>
<td width="79" height="22" valign="top">           3.0+5V         </td>
<td width="375" height="22" valign="top">           电源正         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           3         </td>
<td width="85" height="22" valign="top">           V0         </td>
<td width="79" height="22" valign="top">           &#8211;         </td>
<td width="375" height="22" valign="top">           对比度（亮度）调整         </td>
</tr>
<tr>
<td width="70" height="44" valign="top">           4         </td>
<td width="85" height="44">           RS(CS）         </td>
<td width="79" height="44">           H/L         </td>
<td width="375" height="44" valign="top">           RS=“H”,表示DB7——DB0为显示数据              <br />
    RS=“L”,表示DB7——DB0为显示指令数据         </td>
</tr>
<tr>
<td width="70" height="44" valign="top">           5         </td>
<td width="85" height="44">           R/W(SID)         </td>
<td width="79" height="44">           H/L         </td>
<td width="375" height="44" valign="top">           R/W=“H”,E=“H”,数据被读到DB7——DB0              <br />
      R/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR         </td>
</tr>
<tr>
<td width="70" height="22">           6         </td>
<td width="85" height="22" valign="top">           E(SCLK)         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           使能信号         </td>
</tr>
<tr>
<td width="70" height="22">           7         </td>
<td width="85" height="22" valign="top">           DB0         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           8         </td>
<td width="85" height="22" valign="top">           DB1         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           9         </td>
<td width="85" height="22" valign="top">           DB2         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           10         </td>
<td width="85" height="22" valign="top">           DB3         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           11         </td>
<td width="85" height="22" valign="top">           DB4         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           12         </td>
<td width="85" height="22" valign="top">           DB5         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           13         </td>
<td width="85" height="22" valign="top">           DB6         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           14         </td>
<td width="85" height="22" valign="top">           DB7         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           三态数据线         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           15         </td>
<td width="85" height="22" valign="top">           PSB         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           H：8位或4位并口方式，L：串口方式（见注释1）         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           16         </td>
<td width="85" height="22" valign="top">           NC         </td>
<td width="79" height="22" valign="top">           &#8211;         </td>
<td width="375" height="22" valign="top">           空脚         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           17         </td>
<td width="85" height="22" valign="top">           /RESET         </td>
<td width="79" height="22" valign="top">           H/L         </td>
<td width="375" height="22" valign="top">           复位端，低电平有效（见注释2）         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           18         </td>
<td width="85" height="22" valign="top">           VOUT         </td>
<td width="79" height="22" valign="top">           &#8211;         </td>
<td width="375" height="22" valign="top">           LCD驱动电压输出端         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           19         </td>
<td width="85" height="22" valign="top">           A         </td>
<td width="79" height="22" valign="top">           VDD         </td>
<td width="375" height="22" valign="top">           背光源正端（+5V）（见注释3）         </td>
</tr>
<tr>
<td width="70" height="22" valign="top">           20         </td>
<td width="85" height="22" valign="top">           K         </td>
<td width="79" height="22" valign="top">           VSS         </td>
<td width="375" height="22" valign="top">           背光源负端（见注释3）         </td>
</tr>
</tbody>
</table></div>
<p>*注释1：如在实际应用中仅使用并口通讯模式，可将PSB接固定高电平，也可以将模块上的J8和“VCC”用焊锡短接。</p>
<p>*注释2：模块内部接有上电复位电路，因此在不需要经常复位的场合可将该端悬空。</p>
<p>*注释3：如背光和模块共用一个电源，可以将模块上的JA、JK用焊锡短接。</p>
<p><strong>时序图：</strong></p>
<p align="center"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image001[8]" border="0" alt="clip_image001[8]" src="http://xnian.com/wp-content/uploads/2009/07/clip-image0018.jpg" width="609" height="270" />MPU写资料到ST7920（8位数据线模式）</p>
<p align="center"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image002" border="0" alt="clip_image002" src="http://xnian.com/wp-content/uploads/2009/07/clip-image002.jpg" width="609" height="268" />MPU 从ST7920读资料（8位数据线模式）</p>
<p><strong>外观图：</strong></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image001" border="0" alt="clip_image001" src="http://xnian.com/wp-content/uploads/2009/07/clip-image001.jpg" width="624" height="360" /></p>
<p>具体的我就不再赘述了，下面的doc文档里面都有，是我从网上搜刮来的，嘿嘿……</p>
<p> <iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-92e875252343697a.skydrive.live.com/embedrowdetail.aspx/.Public/12864%e4%b8%ad%e6%96%87%e5%ad%97%e5%ba%93%e8%af%b4%e6%98%8e%e4%b9%a6.doc" frameborder="0" marginwidth="0" scrolling="no"></iframe>
<p>里面的那个程序好像有问题，我烧进89S52之后全是乱码，于是我写了下面这个程序：</p>

<div class="wp_codebox"><table><tr id="p15982"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
</pre></td><td class="code" id="p1598code2"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;REG52.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
<span style="color: #339933;">#include &lt;intrins.h&gt;</span>
&nbsp;
<span style="color: #339933;">#define uint  unsigned int</span>
<span style="color: #339933;">#define uchar unsigned char</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
sbit LCM_psb  <span style="color: #339933;">=</span> P2<span style="color: #339933;">^</span><span style="color: #0000dd;">3</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//H=并口; L=串口;</span>
sbit LCM_rst  <span style="color: #339933;">=</span> P2<span style="color: #339933;">^</span><span style="color: #0000dd;">4</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//Reset Signal 低电平有效</span>
sbit LCM_cs   <span style="color: #339933;">=</span> P2<span style="color: #339933;">^</span><span style="color: #0000dd;">5</span><span style="color: #339933;">;</span>
sbit LCM_std  <span style="color: #339933;">=</span> P2<span style="color: #339933;">^</span><span style="color: #0000dd;">6</span><span style="color: #339933;">;</span>
sbit LCM_sclk <span style="color: #339933;">=</span> P2<span style="color: #339933;">^</span><span style="color: #0000dd;">7</span><span style="color: #339933;">;</span>
sbit ACC0 <span style="color: #339933;">=</span> ACC<span style="color: #339933;">^</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
sbit ACC7 <span style="color: #339933;">=</span> ACC<span style="color: #339933;">^</span><span style="color: #0000dd;">7</span><span style="color: #339933;">;</span>
uchar code tab1<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span>
<span style="color: #ff0000;">&quot;   xnian.com    &quot;</span>
<span style="color: #ff0000;">&quot;欢迎使用这个程序&quot;</span>
<span style="color: #ff0000;">&quot;    纪小年      &quot;</span>
<span style="color: #ff0000;">&quot;  这人是谁啊？  &quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//函数声明</span>
<span style="color: #993333;">void</span> LCM_WriteString<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>str<span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//写字符  例：LCM_WriteString(&quot;您好！&quot;);</span>
<span style="color: #993333;">void</span> LCM_WriteDatOrCom<span style="color: #009900;">&#40;</span>bit <span style="color: #339933;">,</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//（0，指令） （1，数据）</span>
<span style="color: #993333;">void</span> DelayM<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> a<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			<span style="color: #666666; font-style: italic;">//延时</span>
<span style="color: #993333;">void</span> LCM_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//LCM初始化</span>
<span style="color: #993333;">void</span> LCM_clr<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//清屏</span>
<span style="color: #993333;">void</span> Delay<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//延时函数 1MS/次</span>
<span style="color: #993333;">void</span> DelayM<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> a<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">--</span>a <span style="color: #339933;">!=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
       <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">125</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		<span style="color: #666666; font-style: italic;">//一个 ; 表示空语句,CPU空转。</span>
	<span style="color: #009900;">&#125;</span>					<span style="color: #666666; font-style: italic;">//i 从0加到125，CPU大概就耗时1毫秒</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//初始化LCM</span>
<span style="color: #993333;">void</span> LCM_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	LCM_rst<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	LCM_psb<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	LCM_WriteDatOrCom <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		<span style="color: #666666; font-style: italic;">//30---基本指令动作</span>
	LCM_WriteDatOrCom <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x01</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		<span style="color: #666666; font-style: italic;">//清屏，地址指针指向00H</span>
	Delay <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	LCM_WriteDatOrCom <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x06</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		<span style="color: #666666; font-style: italic;">//光标的移动方向</span>
	LCM_WriteDatOrCom<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x0c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		<span style="color: #666666; font-style: italic;">//开显示，关游标</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//写指令或数据  （0，指令） （1，数据）</span>
<span style="color: #993333;">void</span> LCM_WriteDatOrCom<span style="color: #009900;">&#40;</span>bit dat_comm<span style="color: #339933;">,</span>uchar content<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	uchar a<span style="color: #339933;">,</span>i<span style="color: #339933;">,</span>j<span style="color: #339933;">;</span>
	Delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	a<span style="color: #339933;">=</span>content<span style="color: #339933;">;</span>
	LCM_cs<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	LCM_std<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">5</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
		LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	LCM_std<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>dat_comm<span style="color: #009900;">&#41;</span>
		LCM_std<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>			<span style="color: #666666; font-style: italic;">//data</span>
	<span style="color: #b1b100;">else</span>
		LCM_std<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>			<span style="color: #666666; font-style: italic;">//command</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	LCM_std<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>j<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">4</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			a<span style="color: #339933;">=</span>a<span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
			LCM_std<span style="color: #339933;">=</span>CY<span style="color: #339933;">;</span>
			LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
			LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		LCM_std<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">4</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
			LCM_sclk<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #993333;">void</span> chn_disp <span style="color: #009900;">&#40;</span>uchar code <span style="color: #339933;">*</span>chn<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	uchar i<span style="color: #339933;">,</span>j<span style="color: #339933;">;</span>
	LCM_WriteDatOrCom  <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	LCM_WriteDatOrCom  <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x80</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>j<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">4</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">16</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		LCM_WriteDatOrCom  <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span>chn<span style="color: #009900;">&#91;</span>j<span style="color: #339933;">*</span><span style="color: #0000dd;">16</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//清屏函数</span>
<span style="color: #993333;">void</span> LCM_clr<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	LCM_WriteDatOrCom <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	LCM_WriteDatOrCom <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #208080;">0x01</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Delay <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">180</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//向LCM发送一个字符串,长度64字符之内。</span>
<span style="color: #666666; font-style: italic;">//应用：LCM_WriteString(&quot;您好！&quot;);</span>
<span style="color: #993333;">void</span> LCM_WriteString<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>str<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>str <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'<span style="color: #006699; font-weight: bold;">\0</span>'</span><span style="color: #009900;">&#41;</span>
       <span style="color: #009900;">&#123;</span>
		LCM_WriteDatOrCom<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,*</span>str<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
	<span style="color: #339933;">*</span>str <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//延时函数</span>
<span style="color: #993333;">void</span> Delay<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> num<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>num<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/*****************************************************************************/</span>
<span style="color: #666666; font-style: italic;">//主程序</span>
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	LCM_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//初始化液晶显示器</span>
	LCM_clr<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//清屏</span>
	chn_disp<span style="color: #009900;">&#40;</span>tab1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>				<span style="color: #666666; font-style: italic;">//显示欢迎字</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>应小鬼同学的要求，我把12864的硬件图拍了一张，嘿嘿……</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" src="http://xnian.com/wp-content/uploads/2009/07/12864e7a1ace4bbb6e59bbe.jpg" alt="12864硬件图" title="12864硬件图" width="600" height="450" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://xnian.com/2009/07/1598.html/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>MP28GA步进电机+ULN2003APG驱动相关资料</title>
		<link>http://xnian.com/2009/07/1590.html</link>
		<comments>http://xnian.com/2009/07/1590.html#comments</comments>
		<pubDate>Wed, 08 Jul 2009 06:14:59 +0000</pubDate>
		<dc:creator>纪小年</dc:creator>
				<category><![CDATA[单片机]]></category>
		<category><![CDATA[电子设计]]></category>
		<category><![CDATA[电子大赛]]></category>
		<category><![CDATA[资料]]></category>
		<category><![CDATA[驱动]]></category>

		<guid isPermaLink="false">http://xnian.com/?p=1590</guid>
		<description><![CDATA[前些日子在淘宝采购了一个步进电机，一直没用，丢在角落里面。今天实验室停电了，在出租房里有些无聊翻出来研究了下。 步进电机的基本原理我就不说了，百度能找出一大片来，懒的百度的可以点我，简而言之就是能够通过输入脉冲的个数，确定旋转的角位移，一般用他来控制小车轮子的偏移角度等。 来看看我买到的步进电机： 如题目所示，我买到的是型号为MP28GA的步进电机（左）和ULN2003APG的驱动芯片（右），具体参数如下： 电压 DC.V 电阻(25°C) Ω 步距角 ° 减速比 牵入转矩 mN.m 自定位转矩 mN.m 5 50 5.625/64 1/64 ≥40 ≥34.3 空载牵入频率 Hz 空载牵出频率 Hz 绝缘电阻 DC.500V 绝缘介电强度 AC.600V.1mA.1S 温升 K 噪音 dB(A) ≥500 ≥900 ≥50MΩ 无击穿或飞弧 ＜40 ＜40 MP28GA的步进电机相关参数 步进电机相励磁的励磁顺序如下表所示： 接线端 导线 &#160; &#160; 分 配 顺 序 &#160; &#160; 序号 颜色 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>前些日子在淘宝采购了一个步进电机，一直没用，丢在角落里面。今天实验室停电了，在出租房里有些无聊翻出来研究了下。</p>
<p>步进电机的基本原理我就不说了，百度能找出一大片来，懒的百度的可以<a href="http://www.willar.com/article_view.asp?id=345" target="_blank">点我</a>，简而言之就是能够通过输入脉冲的个数，确定旋转的角位移，一般用他来控制小车轮子的偏移角度等。</p>
<p>来看看我买到的步进电机：</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="外观" border="0" alt="外观" src="http://xnian.com/wp-content/uploads/2009/07/1972d52ef233.jpg" width="430" height="164" /></p>
<p>如题目所示，我买到的是型号为MP28GA的步进电机（左）和ULN2003APG的驱动芯片（右），具体参数如下：</p>
<div align="center">
<table border="1" cellspacing="0" cellpadding="2" width="597" align="center">
<tbody>
<tr height="44">
<td width="106" align="center">电压            <br />DC.V</td>
<td width="108" align="center">电阻(25°C)            <br />Ω</td>
<td width="87" align="center">步距角            <br />°</td>
<td width="122" align="center">减速比</td>
<td width="79" align="center">牵入转矩            <br />mN.m</td>
<td width="87" align="center">自定位转矩            <br />mN.m</td>
</tr>
<tr height="22">
<td width="106" align="center">5</td>
<td width="108" align="center">50</td>
<td width="87" align="center">5.625/64</td>
<td width="122" align="center">1/64</td>
<td width="79" align="center">
<pre>≥40</pre>
</td>
<td width="86" align="center">
<pre>≥34.3</pre>
</td>
</tr>
<tr height="44">
<td width="106" align="center">空载牵入频率<br />
          <br />Hz</td>
<td width="108" align="center">空载牵出频率<br />
          <br />Hz</td>
<td width="87" align="center">绝缘电阻<br />
          <br />DC.500V</td>
<td width="122" align="center">绝缘介电强度<br />
          <br />AC.600V.1mA.1S</td>
<td width="79" align="center">温升<br />
          <br />K</td>
<td width="86" align="center">噪音<br />
          <br />dB(A)</td>
</tr>
<tr height="22">
<td width="106" align="center">≥500</td>
<td width="108" align="center">≥900</td>
<td width="87" align="center">≥50MΩ</td>
<td width="122" align="center">无击穿或飞弧</td>
<td width="79" align="center">＜40</td>
<td width="86" align="center">＜40</td>
</tr>
</tbody>
</table>
</div>
<div align="center">MP28GA的步进电机相关参数</div>
<p>步进电机相励磁的励磁顺序如下表所示：</p>
<div align="center">
<table border="1" cellspacing="0" cellpadding="2" width="618" align="center">
<tbody>
<tr>
<td width="62" align="center">接线端</td>
<td width="62" align="center">导线</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
<td width="62" align="center">分</td>
<td width="62" align="center">配</td>
<td width="62" align="center">顺</td>
<td width="62" align="center">序</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
</tr>
<tr>
<td width="62" align="center">序号</td>
<td width="62" align="center">颜色</td>
<td width="61" align="center">1</td>
<td width="61" align="center">2</td>
<td width="62" align="center">3</td>
<td width="62" align="center">4</td>
<td width="62" align="center">5</td>
<td width="62" align="center">6</td>
<td width="61" align="center">7</td>
<td width="61" align="center">8</td>
</tr>
<tr>
<td width="62" align="center">5</td>
<td width="62" align="center">红</td>
<td width="61" align="center">+</td>
<td width="61" align="center">+</td>
<td width="62" align="center">+</td>
<td width="62" align="center">+</td>
<td width="62" align="center">+</td>
<td width="62" align="center">+</td>
<td width="61" align="center">+</td>
<td width="61" align="center">+</td>
</tr>
<tr>
<td width="62" align="center">4</td>
<td width="62" align="center">橙</td>
<td width="61" align="center">-</td>
<td width="61" align="center">-</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">-</td>
</tr>
<tr>
<td width="62" align="center">3</td>
<td width="62" align="center">黄</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">-</td>
<td width="62" align="center">-</td>
<td width="62" align="center">-</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
</tr>
<tr>
<td width="62" align="center">2</td>
<td width="62" align="center">粉</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">-</td>
<td width="62" align="center">-</td>
<td width="62" align="center">-</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
</tr>
<tr>
<td width="62" align="center">1</td>
<td width="62" align="center">蓝</td>
<td width="61" align="center">&#160;</td>
<td width="61" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">&#160;</td>
<td width="62" align="center">-</td>
<td width="61" align="center">-</td>
<td width="62" align="center">-</td>
</tr>
</tbody>
</table>
</div>
<p>ULN2003APG的驱动芯片驱动原理图如下所示：<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image3.png" width="531" height="326" /> </p>
<p>程序示例：</p>

<div class="wp_codebox"><table><tr id="p15904"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</pre></td><td class="code" id="p1590code4"><pre class="asm" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">;****************************步进电机的驱动*************************************</span>
<span style="color: #666666; font-style: italic;">;FOSC = 12MHz</span>
<span style="color: #666666; font-style: italic;">;---------------------------------------------------------------------------------</span>
<span style="color: #666666; font-style: italic;">; 步进电机的驱动信号必须为脉冲信号!!! 转动的速度和脉冲的频率成正比!!!</span>
<span style="color: #666666; font-style: italic;">; 本步进电机步进角为 5.625度 . 一圈 360 度 , 需要64个脉冲完成!!!</span>
<span style="color: #666666; font-style: italic;">;---------------------------------------------------------------------------------</span>
<span style="color: #666666; font-style: italic;">; A组线圈对应 P2.4</span>
<span style="color: #666666; font-style: italic;">; B组线圈对应 P2.5</span>
<span style="color: #666666; font-style: italic;">; C组线圈对应 P2.6</span>
<span style="color: #666666; font-style: italic;">; D组线圈对应 P2.7</span>
<span style="color: #666666; font-style: italic;">; 正转次序: AB组--BC组--CD组--DA组 (即一个脉冲,正转5.625度)</span>
<span style="color: #666666; font-style: italic;">;----------------------------------------------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">ORG</span> <span style="color: #0000ff;">0000H</span>
	<span style="color: #000000; font-weight: bold;">LJMP</span>	MAIN
<span style="color: #000000; font-weight: bold;">ORG</span> <span style="color: #0000ff;">0100H</span>
&nbsp;
MAIN<span style="color: #339933;">:</span>
<span style="color: #666666; font-style: italic;">;----------------------------正转--------------------------</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	R3<span style="color: #339933;">,</span>#<span style="color: #0000ff;">192</span>		<span style="color: #666666; font-style: italic;">;正转3圈共192个脉冲</span>
START<span style="color: #339933;">:</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	R0<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00H</span>
START1<span style="color: #339933;">:</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	P2<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00H</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	A<span style="color: #339933;">,</span>R0
	<span style="color: #00007f; font-weight: bold;">MOV</span>	DPTR<span style="color: #339933;">,</span>#TABLE
	MOVC	A<span style="color: #339933;">,</span>@A<span style="color: #339933;">+</span>DPTR
	<span style="color: #00007f; font-weight: bold;">JZ</span>	START		<span style="color: #666666; font-style: italic;">;对A的判断,当A=0时则转到 START</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	P2<span style="color: #339933;">,</span>A
	LCALL	DELAY
	<span style="color: #00007f; font-weight: bold;">INC</span>	R0
	DJNZ	R3<span style="color: #339933;">,</span>START1
	<span style="color: #00007f; font-weight: bold;">MOV</span>	P2<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00H</span>
	LCALL	DELAY1
<span style="color: #666666; font-style: italic;">;-----------------------------反转------------------------</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	R3<span style="color: #339933;">,</span>#<span style="color: #0000ff;">64</span>		<span style="color: #666666; font-style: italic;">;反转一圈共64个脉冲</span>
START2<span style="color: #339933;">:</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	P2<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00H</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	R0<span style="color: #339933;">,</span>#<span style="color: #0000ff;">05</span>
START3<span style="color: #339933;">:</span>
	<span style="color: #00007f; font-weight: bold;">MOV</span>	A<span style="color: #339933;">,</span>R0
	<span style="color: #00007f; font-weight: bold;">MOV</span>	DPTR<span style="color: #339933;">,</span>#TABLE
	MOVC	A<span style="color: #339933;">,</span>@A<span style="color: #339933;">+</span>DPTR
	<span style="color: #00007f; font-weight: bold;">JZ</span>	START2
	<span style="color: #00007f; font-weight: bold;">MOV</span>	P2<span style="color: #339933;">,</span>A
	<span style="color: #00007f; font-weight: bold;">CALL</span>	DELAY
	<span style="color: #00007f; font-weight: bold;">INC</span>	R0
	DJNZ	R3<span style="color: #339933;">,</span>START3
	<span style="color: #00007f; font-weight: bold;">MOV</span>	P2<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00H</span>
	LCALL	DELAY1
	<span style="color: #000000; font-weight: bold;">LJMP</span> MAIN
<span style="color: #666666; font-style: italic;">;---------------------------转速控制-----------------------</span>
DELAY<span style="color: #339933;">:</span>	<span style="color: #00007f; font-weight: bold;">MOV</span>	R7<span style="color: #339933;">,</span>#<span style="color: #0000ff;">40</span>		<span style="color: #666666; font-style: italic;">;步进电机的转速</span>
M3<span style="color: #339933;">:</span>	<span style="color: #00007f; font-weight: bold;">MOV</span>	R6<span style="color: #339933;">,</span>#<span style="color: #0000ff;">248</span>
	DJNZ	R6<span style="color: #339933;">,</span>$
	DJNZ	R7<span style="color: #339933;">,</span>M3
	<span style="color: #00007f; font-weight: bold;">RET</span>
<span style="color: #666666; font-style: italic;">;---------------------------延时控制----------------------</span>
DELAY1<span style="color: #339933;">:</span> 	<span style="color: #00007f; font-weight: bold;">MOV</span>	R4<span style="color: #339933;">,</span>#<span style="color: #0000ff;">20</span>	<span style="color: #666666; font-style: italic;">;2S 延时子程序</span>
DEL2<span style="color: #339933;">:</span> 	<span style="color: #00007f; font-weight: bold;">MOV</span>	R3<span style="color: #339933;">,</span>#<span style="color: #0000ff;">200</span>
DEL3<span style="color: #339933;">:</span>	<span style="color: #00007f; font-weight: bold;">MOV</span>	R2<span style="color: #339933;">,</span>#<span style="color: #0000ff;">250</span>
	DJNZ	R2<span style="color: #339933;">,</span>$
	DJNZ	R3<span style="color: #339933;">,</span>DEL3
	DJNZ	R4<span style="color: #339933;">,</span>DEL2
	<span style="color: #00007f; font-weight: bold;">RET</span>
<span style="color: #666666; font-style: italic;">;---------------------------正反转表----------------------</span>
TABLE<span style="color: #339933;">:</span>
	<span style="color: #000000; font-weight: bold;">DB</span>	<span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">0C0H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">90H</span><span style="color: #666666; font-style: italic;">;  正转表</span>
	<span style="color: #000000; font-weight: bold;">DB</span>	<span style="color: #0000ff;">00</span><span style="color: #666666; font-style: italic;">;  正转结束</span>
	<span style="color: #000000; font-weight: bold;">DB</span>	<span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">90H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">0C0H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">60H</span><span style="color: #666666; font-style: italic;">;  反转表</span>
	<span style="color: #000000; font-weight: bold;">DB</span>	<span style="color: #0000ff;">00</span><span style="color: #666666; font-style: italic;">;  反转结束</span>
<span style="color: #000000; font-weight: bold;">END</span></pre></td></tr></table></div>

<p>有不少童鞋问我要这个电机的资料，其实在这篇文章里面都提到了。为了不耽误大家使用的时间，还是把资料放在文章里面供大家下载吧，嘿嘿</p>
<p><iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:26px;margin:3px;padding:0;border:1px solid #ffff00;background-color:#000000;" src="http://cid-92e875252343697a.skydrive.live.com/embedrow.aspx/.Public/%e6%ad%a5%e8%bf%9b%e7%94%b5%e6%9c%ba.rar"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://xnian.com/2009/07/1590.html/feed</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>单片机89S51水温控制系统</title>
		<link>http://xnian.com/2009/07/1564.html</link>
		<comments>http://xnian.com/2009/07/1564.html#comments</comments>
		<pubDate>Fri, 03 Jul 2009 09:03:34 +0000</pubDate>
		<dc:creator>纪小年</dc:creator>
				<category><![CDATA[单片机]]></category>
		<category><![CDATA[电子设计]]></category>
		<category><![CDATA[C51]]></category>

		<guid isPermaLink="false">http://xnian.com/?p=1564</guid>
		<description><![CDATA[一、摘要 该系统主电路采用89S51单片机实现温度控制，加热和制冷部分由于条件限制，只采用模拟的方式。电路可实现温度的显示，设置上下限温度，超出范围报警以及和PC机通信的功能。系统测量精度和控制精度良好。我们为本系统共设计了两套程序，我主要负责其中一套程序的编写和单片机最小系统板的组建。 二、方案选择 本系统采用89S51单片机系统来实现。单片机软件编程灵活、自由度大，可用软件编程实现各种控制看法和逻辑控制。可实现数码显示和键盘设定等多种功能，系统电路框图如下： 采用以89S51为控制核心的单片机控制系统，尤其对温度控制，它可达到模拟控制所达不到的控制效果，并且可实现显示、键盘设定等多种功能，又易于扩展，大大提高了系统的智能化，也使得系统所测结果精度大大提高。故选择方案三。 三、器件选择 由于单片机最小系统板采用的是去年省赛的板子，所以受到了很多限制。如对系统精度至关重要的A/D转换换器，板子上采用的是ADC0809。因为是八位的，所以精度不高，最多只能达到0.4度左右。但考虑到已有现成的板子，采用0809同样可达到实验的目的，所以A/D部分暂不作更改。 传感器部分既可采用热敏电阻，也可采用集成的温度传感器。但由于热敏电阻的精度、重复性、可靠性都比较差，所以我们采用的集成的LM35，LM35是一个三端器件（电源、地、输出），的是NS公司生产的集成电路温度传感器系列产品之一，它具有很高工作精度和较宽的线性工作范围，该器件输出电压与摄氏温度线性成比例。LM35与用开尔文标准的线性温度传感器相比更有优越之处，LM35无需外部校准或微调，可以提供±1/4℃的常用的室温精度。其灵敏度为+10.0mV/℃，精度在+25℃时为0.5℃。精度较高，并且价格较低，每片仅售6元。较之性能较好的AD590K便宜许多，性价比高。故采用LM35而舍弃AD590K。 四、电路原理图 单片机最小系统部分： ADC0809的A/D采样部分： 四位LED数码管显示部分： 单片机串口通信电路： 温度采集部分： 报警电路：温控模拟部分： 五、工作原理 具体电路原理详见本组另一成员的报告，在此仅介绍系统的软件部分,我们总共写了两份程序，其中一份为我个人独立完成。下面为程序的主要流程图。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 [...]]]></description>
			<content:encoded><![CDATA[<p><b>一、摘要</b></p>
<p>该系统主电路采用89S51单片机实现温度控制，加热和制冷部分由于条件限制，只采用模拟的方式。电路可实现温度的显示，设置上下限温度，超出范围报警以及和PC机通信的功能。系统测量精度和控制精度良好。我们为本系统共设计了两套程序，我主要负责其中一套程序的编写和单片机最小系统板的组建。</p>
<p><b>二、方案选择</b></p>
<p>本系统采用89S51单片机系统来实现。单片机软件编程灵活、自由度大，可用软件编程实现各种控制看法和逻辑控制。可实现数码显示和键盘设定等多种功能，系统电路框图如下： <img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://xnian.com/wp-content/uploads/2009/07/image.png" width="398" height="150" /> 采用以89S51为控制核心的单片机控制系统，尤其对温度控制，它可达到模拟控制所达不到的控制效果，并且可实现显示、键盘设定等多种功能，又易于扩展，大大提高了系统的智能化，也使得系统所测结果精度大大提高。故选择方案三。</p>
<p><b>三、器件选择</b></p>
<p>由于单片机最小系统板采用的是去年省赛的板子，所以受到了很多限制。如对系统精度至关重要的A/D转换换器，板子上采用的是ADC0809。因为是八位的，所以精度不高，最多只能达到0.4度左右。但考虑到已有现成的板子，采用0809同样可达到实验的目的，所以A/D部分暂不作更改。</p>
<p>传感器部分既可采用热敏电阻，也可采用集成的温度传感器。但由于热敏电阻的精度、重复性、可靠性都比较差，所以我们采用的集成的LM35，LM35是一个三端器件（电源、地、输出），的是NS公司生产的集成电路温度传感器系列产品之一，它具有很高工作精度和较宽的线性工作范围，该器件输出电压与摄氏温度线性成比例。LM35与用开尔文标准的线性温度传感器相比更有优越之处，LM35无需外部校准或微调，可以提供±1/4℃的常用的室温精度。其灵敏度为+10.0mV/℃，精度在+25℃时为0.5℃。精度较高，并且价格较低，每片仅售6元。较之性能较好的AD590K便宜许多，性价比高。故采用LM35而舍弃AD590K。</p>
<p> <span id="more-1564"></span>
<p><b>四、电路原理图</b></p>
<p><b>单片机最小系统部分：</b></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image003" border="0" alt="clip_image003" src="http://xnian.com/wp-content/uploads/2009/07/clip-image003.jpg" width="468" height="367" /></p>
<p><b>ADC0809的A/D采样部分：</b></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image005" border="0" alt="clip_image005" src="http://xnian.com/wp-content/uploads/2009/07/clip-image005.jpg" width="488" height="320" /></p>
<p><b>四位LED数码管显示部分：</b></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image006" border="0" hspace="12" alt="clip_image006" src="http://xnian.com/wp-content/uploads/2009/07/clip-image006.jpg" width="559" height="407" /></p>
<p><b>单片机串口通信电路：</b></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image008" border="0" alt="clip_image008" src="http://xnian.com/wp-content/uploads/2009/07/clip-image008.gif" width="304" height="219" /></p>
<p><b>温度采集部分：</b></p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image010" border="0" alt="clip_image010" src="http://xnian.com/wp-content/uploads/2009/07/clip-image010.jpg" width="486" height="297" /></p>
<div><b>报警电路：温控模拟部分：</b> </div>
<div align="center">
<table cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr>
<td valign="top"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image013" border="0" alt="clip_image013" src="http://xnian.com/wp-content/uploads/2009/07/clip-image013.jpg" width="278" height="213" /></td>
<td valign="top" width="295"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="clip_image014" border="0" alt="clip_image014" src="http://xnian.com/wp-content/uploads/2009/07/clip-image014.jpg" width="282" height="213" /></td>
</tr>
</tbody>
</table></div>
<p><b>五、</b><b>工作原理</b></p>
<p>具体电路原理详见本组另一成员的报告，在此仅介绍系统的软件部分,我们总共写了两份程序，其中一份为我个人独立完成。下面为程序的主要流程图。</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="程序框图" border="0" alt="程序框图" src="http://xnian.com/wp-content/uploads/2009/07/a0e33edaf8b0.jpg" width="451" height="791" /></p>

<div class="wp_codebox"><table><tr id="p15646"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
</pre></td><td class="code" id="p1564code6"><pre class="asm" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">;显示区地址分别为63H，62H，61H，60H</span>
<span style="color: #666666; font-style: italic;">;上限温度地址分别为2EH，2DH，2CH</span>
<span style="color: #666666; font-style: italic;">;下限温度地址分别为2BH，2AH，29H</span>
<span style="color: #666666; font-style: italic;">;用到的位地址有00H，01H，30H</span>
<span style="color: #666666; font-style: italic;">; ===============主程序===============</span>
<span style="color: #000000; font-weight: bold;">ORG</span> <span style="color: #0000ff;">0000H</span>
<span style="color: #000000; font-weight: bold;">LJMP</span> MAIN
<span style="color: #000000; font-weight: bold;">ORG</span> <span style="color: #0000ff;">0003H</span>
<span style="color: #000000; font-weight: bold;">LJMP</span> INT0
<span style="color: #000000; font-weight: bold;">ORG</span> <span style="color: #0000ff;">0030H</span>
MAIN<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #00007f;">SP</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">70H</span> <span style="color: #666666; font-style: italic;">;置初值</span>
CLR P1<span style="color: #339933;">.</span>7
<span style="color: #00007f; font-weight: bold;">MOV</span> R0<span style="color: #339933;">,</span>#<span style="color: #0000ff;">40H</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> PSW<span style="color: #339933;">.</span>4
<span style="color: #00007f; font-weight: bold;">SETB</span> PSW<span style="color: #339933;">.</span>3
<span style="color: #00007f; font-weight: bold;">SETB</span> IT0
<span style="color: #00007f; font-weight: bold;">SETB</span> EA
<span style="color: #00007f; font-weight: bold;">SETB</span> EX0
<span style="color: #00007f; font-weight: bold;">MOV</span> TMOD<span style="color: #339933;">,</span>#<span style="color: #0000ff;">20H</span> <span style="color: #666666; font-style: italic;">;波特率9600</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> TH1<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0FDH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> TL1<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0FDH</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> TR1
<span style="color: #00007f; font-weight: bold;">MOV</span> SCON<span style="color: #339933;">,</span>#<span style="color: #0000ff;">50H</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> TI
CLR <span style="color: #0000ff;">30H</span>
CLR <span style="color: #0000ff;">01H</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> P1<span style="color: #339933;">.</span>7
CLR P1<span style="color: #339933;">.</span>6
CLR P1<span style="color: #339933;">.</span>5
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0BFFFH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">00H</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2EH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2DH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2CH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2BH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2AH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">29H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0</span>
<span style="color: #00007f; font-weight: bold;">LOOP</span><span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0BFFFH</span>
MOVX @DPTR<span style="color: #339933;">,</span>A <span style="color: #666666; font-style: italic;">;启动A/D转换</span>
CLR <span style="color: #0000ff;">00H</span>
<span style="color: #00007f; font-weight: bold;">WAIT</span><span style="color: #339933;">:</span> LCALL XUAN
CHAXUN<span style="color: #339933;">:</span><span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>3<span style="color: #339933;">,</span>LOOP1 <span style="color: #666666; font-style: italic;">;调整</span>
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>4<span style="color: #339933;">,</span>LOOP2 <span style="color: #00007f; font-weight: bold;">JNB</span> <span style="color: #0000ff;">00H</span><span style="color: #339933;">,</span>GG <span style="color: #666666; font-style: italic;">;判断是否再启动</span>
<span style="color: #000000; font-weight: bold;">LJMP</span> <span style="color: #00007f; font-weight: bold;">LOOP</span>
GG<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">LJMP</span> <span style="color: #00007f; font-weight: bold;">WAIT</span>
<span style="color: #666666; font-style: italic;">;===========上限温度调整===========</span>
LOOP1<span style="color: #339933;">:</span> CLR EX0
LCALL DELAY1
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>3<span style="color: #339933;">,</span>$
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2EH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2DH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2CH</span>
<span style="color: #00007f; font-weight: bold;">JB</span> P1<span style="color: #339933;">.</span>2<span style="color: #339933;">,</span>M2
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2EH</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">01</span>
DA A
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2EH</span><span style="color: #339933;">,</span>A
CJNE A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10H</span><span style="color: #339933;">,</span>M1
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2EH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">00</span>
M1<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>2<span style="color: #339933;">,</span>$
M2<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JB</span> P1<span style="color: #339933;">.</span>1<span style="color: #339933;">,</span>M4
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2DH</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">01H</span>
DA A
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2DH</span><span style="color: #339933;">,</span>A
CJNE A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10H</span><span style="color: #339933;">,</span>M3
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2DH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">00</span>
M3<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>1<span style="color: #339933;">,</span>$
M4<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JB</span> P1<span style="color: #339933;">.</span>0<span style="color: #339933;">,</span>M5
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2CH</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">01</span>
DA A
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2CH</span><span style="color: #339933;">,</span>A
CJNE A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10H</span><span style="color: #339933;">,</span>M5
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2CH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">00</span>
M5<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>0<span style="color: #339933;">,</span>$
<span style="color: #00007f; font-weight: bold;">SETB</span> <span style="color: #0000ff;">30H</span><span style="color: #666666; font-style: italic;">;是否显示第一位的标志位</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">63H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">11H</span> <span style="color: #666666; font-style: italic;">;显示“上”</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2EH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2DH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2CH</span>
LCALL DELAY
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>3<span style="color: #339933;">,</span>TUI <span style="color: #666666; font-style: italic;">;再次中断时，退出</span>
<span style="color: #000000; font-weight: bold;">LJMP</span> LOOP1
<span style="color: #666666; font-style: italic;">;==========下限温度调整===========</span>
LOOP2<span style="color: #339933;">:</span> CLR EX0
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>3<span style="color: #339933;">,</span>$&amp;#<span style="color: #0000ff;">160</span><span style="color: #666666; font-style: italic;">; MOV 62H,2BH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2AH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">29H</span>
<span style="color: #00007f; font-weight: bold;">JB</span> P1<span style="color: #339933;">.</span>2<span style="color: #339933;">,</span>L2
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2BH</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">01</span>
DA A
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2BH</span><span style="color: #339933;">,</span>A
CJNE A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10H</span><span style="color: #339933;">,</span>L1
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2BH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">00</span>
L1<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>2<span style="color: #339933;">,</span>$
L2<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JB</span> P1<span style="color: #339933;">.</span>1<span style="color: #339933;">,</span>L4
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2AH</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">01H</span>
DA A
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2AH</span><span style="color: #339933;">,</span>A
CJNE A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10H</span><span style="color: #339933;">,</span>L3
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2AH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">00</span>
L3<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>1<span style="color: #339933;">,</span>$
L4<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JB</span> P1<span style="color: #339933;">.</span>0<span style="color: #339933;">,</span>L5
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">29H</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">01</span>
DA A
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">29H</span><span style="color: #339933;">,</span>A
CJNE A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10H</span><span style="color: #339933;">,</span>L5
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">29H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">00</span>
L5<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>0<span style="color: #339933;">,</span>$
<span style="color: #00007f; font-weight: bold;">SETB</span> <span style="color: #0000ff;">30H</span><span style="color: #666666; font-style: italic;">;是否显示第一位的标示位</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">63H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0FH</span> <span style="color: #666666; font-style: italic;">;显示“下”</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2BH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">2AH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">29H</span>
LCALL DELAY
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>4<span style="color: #339933;">,</span>TUI <span style="color: #666666; font-style: italic;">;再次中断时，退出</span>
<span style="color: #000000; font-weight: bold;">LJMP</span> LOOP2&amp;#<span style="color: #0000ff;">160</span><span style="color: #666666; font-style: italic;">; TUI: MOV A,2BH</span>
CLR <span style="color: #000000; font-weight: bold;">C</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">2EH</span><span style="color: #339933;">,</span>AA<span style="color: #666666; font-style: italic;">;比较上限是否低于下限</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2AH</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">2DH</span><span style="color: #339933;">,</span>AA
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span>E1
<span style="color: #000000; font-weight: bold;">LJMP</span> E2
E1<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JC</span> SHANG_BAO
<span style="color: #000000; font-weight: bold;">LJMP</span> E2
<span style="color: #666666; font-style: italic;">;======超上限温度报警======</span>
SHANG_BAO<span style="color: #339933;">:</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> P1<span style="color: #339933;">.</span>7
<span style="color: #00007f; font-weight: bold;">SETB</span> P1<span style="color: #339933;">.</span>6
CLR P1<span style="color: #339933;">.</span>5
<span style="color: #000000; font-weight: bold;">LJMP</span> X2
E2<span style="color: #339933;">:</span> CLR P1<span style="color: #339933;">.</span>5
CLR P1<span style="color: #339933;">.</span>6
CLR P1<span style="color: #339933;">.</span>7
X1<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2BH</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span>E3
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2AH</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span>E3
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">29H</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span>E3
<span style="color: #000000; font-weight: bold;">LJMP</span> E4
E3<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNC</span> XIA_BAO
<span style="color: #000000; font-weight: bold;">LJMP</span> E4
<span style="color: #666666; font-style: italic;">;======低于下限温度报警======</span>
XIA_BAO<span style="color: #339933;">:</span><span style="color: #00007f; font-weight: bold;">SETB</span> P1<span style="color: #339933;">.</span>7
<span style="color: #00007f; font-weight: bold;">SETB</span> P1<span style="color: #339933;">.</span>5
CLR P1<span style="color: #339933;">.</span>6
<span style="color: #000000; font-weight: bold;">LJMP</span> X2
E4<span style="color: #339933;">:</span> CLR P1<span style="color: #339933;">.</span>5
CLR P1<span style="color: #339933;">.</span>6
CLR P1<span style="color: #339933;">.</span>7
X2<span style="color: #339933;">:</span> CLR <span style="color: #0000ff;">30H</span>
ACALL DELAY
<span style="color: #666666; font-style: italic;">;========串口通信=========</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> R3<span style="color: #339933;">,</span>#<span style="color: #0000ff;">30H</span> <span style="color: #666666; font-style: italic;">;转ASCII码</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">62H</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>R3
DA A
MLP3<span style="color: #339933;">:</span> JBC TI<span style="color: #339933;">,</span>MLP2 <span style="color: #666666; font-style: italic;">;当TI为１时清0</span>
SJMP MLP3
MLP2<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> SBUF<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">61H</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>R3
DA A&amp;#<span style="color: #0000ff;">160</span><span style="color: #666666; font-style: italic;">; MLP5: JBC TI,MLP4</span>
TT<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0FAFFH</span>
D2<span style="color: #339933;">:</span> MOVX @DPTR<span style="color: #339933;">,</span>A
DJNZ <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>D2 <span style="color: #666666; font-style: italic;">;十位</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">40</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#TAB0
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">60H</span>
MOVC A<span style="color: #339933;">,</span>@A<span style="color: #339933;">+</span>DPTR
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0FBFFH</span>
D3<span style="color: #339933;">:</span> MOVX @DPTR<span style="color: #339933;">,</span>A
DJNZ <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>D3 <span style="color: #666666; font-style: italic;">;个位</span>
<span style="color: #00007f; font-weight: bold;">RET</span>
TAB0<span style="color: #339933;">:</span>DB3FH<span style="color: #339933;">,</span><span style="color: #0000ff;">06H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">5BH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">4FH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">66H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">6DH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">7DH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">07H</span><span style="color: #339933;">,</span>
<span style="color: #666666; font-style: italic;">; 0 1 2 3 4 5 6 7</span>
<span style="color: #0000ff;">7FH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">6FH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">77H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">7CH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">39H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">5EH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">79H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">71H</span>
<span style="color: #666666; font-style: italic;">; 8 9 A B C D E F</span>
<span style="color: #000000; font-weight: bold;">DB</span> <span style="color: #0000ff;">76H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">78H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">38H</span><span style="color: #339933;">,</span><span style="color: #0000ff;">6EH</span><span style="color: #339933;">,</span><span style="color: #0000ff;">00H</span> <span style="color: #339933;">,</span><span style="color: #0000ff;">77H</span><span style="color: #339933;">,</span>
<span style="color: #666666; font-style: italic;">; H K L Y 无 R</span>
DELAY12<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> R4<span style="color: #339933;">,</span><span style="color: #0000ff;">00H</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> R5<span style="color: #339933;">,</span><span style="color: #0000ff;">00H</span>
X3<span style="color: #339933;">:</span> DJNZ R4<span style="color: #339933;">,</span>$
DJNZ R5<span style="color: #339933;">,</span>X3
<span style="color: #00007f; font-weight: bold;">RET</span>
<span style="color: #666666; font-style: italic;">;-------中断0服务程序-------</span>
INT0<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">PUSH</span> A
<span style="color: #00007f; font-weight: bold;">PUSH</span> PSW
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0BFFFH</span>
MOVX A<span style="color: #339933;">,</span>@DPTR <span style="color: #666666; font-style: italic;">;读A/D转换结果</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">2FH</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0FFH</span>
CLR CY <span style="color: #666666; font-style: italic;">;程序调整高低位</span>
RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N1
CLR <span style="color: #0000ff;">78H</span> <span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">29H</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">2CH</span><span style="color: #339933;">,</span>AA
<span style="color: #000000; font-weight: bold;">LJMP</span> XXX <span style="color: #666666; font-style: italic;">;正常</span>
AA<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">JNC</span> ERRO <span style="color: #666666; font-style: italic;">;上限低于下限，跳转&amp;#160; XXX: SETB EX0</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>@R0
LCALL XUAN
<span style="color: #000000; font-weight: bold;">LJMP</span> <span style="color: #00007f; font-weight: bold;">WAIT</span>
ERRO<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">63H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0EH</span> <span style="color: #666666; font-style: italic;">;显示“ERRO”</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">15H</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">15H</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">60H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">0H</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> <span style="color: #0000ff;">30H</span>
<span style="color: #00007f; font-weight: bold;">SETB</span> <span style="color: #0000ff;">01H</span>
<span style="color: #adadad; font-style: italic;">EEEE</span><span style="color: #339933;">:</span> LCALL DELAY
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>3<span style="color: #339933;">,</span>XX1 <span style="color: #666666; font-style: italic;">;是否重新调整</span>
<span style="color: #00007f; font-weight: bold;">JNB</span> P1<span style="color: #339933;">.</span>4<span style="color: #339933;">,</span>XX2
<span style="color: #000000; font-weight: bold;">LJMP</span> EEEE
XX1<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">LJMP</span> LOOP1
XX2<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">LJMP</span> LOOP2
<span style="color: #666666; font-style: italic;">;==========显示数据转换=========</span>
Xian<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>@R0
<span style="color: #00007f; font-weight: bold;">MOV</span> B<span style="color: #339933;">,</span>#<span style="color: #0000ff;">100</span>
<span style="color: #00007f; font-weight: bold;">MUL</span> AB
<span style="color: #00007f; font-weight: bold;">MOV</span> R3<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>B
<span style="color: #00007f; font-weight: bold;">MOV</span> B<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10</span>
<span style="color: #00007f; font-weight: bold;">DIV</span> AB
<span style="color: #00007f; font-weight: bold;">MOV</span> R1<span style="color: #339933;">,</span>#<span style="color: #0000ff;">62H</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> @R1<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">DEC</span> R1
<span style="color: #00007f; font-weight: bold;">MOV</span> @R1<span style="color: #339933;">,</span>B
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>R3
<span style="color: #00007f; font-weight: bold;">MOV</span> B<span style="color: #339933;">,</span>#<span style="color: #0000ff;">10</span>
<span style="color: #00007f; font-weight: bold;">MUL</span> AB
<span style="color: #00007f; font-weight: bold;">DEC</span> R1
<span style="color: #00007f; font-weight: bold;">MOV</span> @R1<span style="color: #339933;">,</span>B
CLR <span style="color: #0000ff;">30H</span>
ACALL DELAY
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2EH</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">62H</span><span style="color: #339933;">,</span>E1
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2DH</span>
CJNE A<span style="color: #339933;">,</span><span style="color: #0000ff;">61H</span><span style="color: #339933;">,</span>E1
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2CH</span>
SJMP MLP5&amp;#<span style="color: #0000ff;">160</span><span style="color: #666666; font-style: italic;">; MLP4: MOV SBUF,A</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">46</span> <span style="color: #666666; font-style: italic;">;小数点</span>
MLP8<span style="color: #339933;">:</span> JBC TI<span style="color: #339933;">,</span>MLP9
SJMP MLP8
MLP9<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> SBUF<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">60H</span>
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>R3
DA A
MLP7<span style="color: #339933;">:</span> JBC TI<span style="color: #339933;">,</span>MLP6
SJMP MLP7
MLP6<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> SBUF<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">32</span>
MLP10<span style="color: #339933;">:</span> JBC TI<span style="color: #339933;">,</span>MLP11
SJMP MLP10
MLP11<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> SBUF<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">RET</span>
<span style="color: #666666; font-style: italic;">;==========延时加显示=========</span>
DELAY<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> R3<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0A0H</span>
D00<span style="color: #339933;">:</span> ACALL DISPLAY
DJNZ R3<span style="color: #339933;">,</span>D00
<span style="color: #00007f; font-weight: bold;">RET</span>
DISPLAY<span style="color: #339933;">:</span><span style="color: #00007f; font-weight: bold;">JNB</span> <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span><span style="color: #000000; font-weight: bold;">DD</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">40</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#TAB0
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">63H</span>
MOVC A<span style="color: #339933;">,</span>@A<span style="color: #339933;">+</span>DPTR
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0F8FFH</span>
D0<span style="color: #339933;">:</span> MOVX @DPTR<span style="color: #339933;">,</span>A
DJNZ <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>D0 <span style="color: #666666; font-style: italic;">;千位</span>
<span style="color: #000000; font-weight: bold;">DD</span><span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">40</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#TAB0
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">62H</span>
MOVC A<span style="color: #339933;">,</span>@A<span style="color: #339933;">+</span>DPTR
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#<span style="color: #0000ff;">0F9FFH</span>
D1<span style="color: #339933;">:</span> MOVX @DPTR<span style="color: #339933;">,</span>A
DJNZ <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>D1 <span style="color: #666666; font-style: italic;">;百位</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> <span style="color: #0000ff;">30H</span><span style="color: #339933;">,</span>#<span style="color: #0000ff;">40</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> DPTR<span style="color: #339933;">,</span>#TAB0
<span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">61H</span>
MOVC A<span style="color: #339933;">,</span>@A<span style="color: #339933;">+</span>DPTR
<span style="color: #00007f; font-weight: bold;">JB</span> <span style="color: #0000ff;">01H</span><span style="color: #339933;">,</span>TT
<span style="color: #00007f; font-weight: bold;">ADD</span> A<span style="color: #339933;">,</span>#<span style="color: #0000ff;">80H</span>
N1<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N2
CLR <span style="color: #0000ff;">79H</span>
N2<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N3
CLR <span style="color: #0000ff;">7AH</span>
N3<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N4
CLR <span style="color: #0000ff;">7BH</span>
N4<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N5
CLR <span style="color: #0000ff;">7CH</span>
N5<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N6
CLR <span style="color: #0000ff;">7DH</span>
N6<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N7
CLR <span style="color: #0000ff;">7EH</span>
N7<span style="color: #339933;">:</span> RLC A
<span style="color: #00007f; font-weight: bold;">JC</span> N8
CLR <span style="color: #0000ff;">7FH</span>
N8<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> A<span style="color: #339933;">,</span><span style="color: #0000ff;">2FH</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> @R0<span style="color: #339933;">,</span>A
<span style="color: #00007f; font-weight: bold;">SETB</span> <span style="color: #0000ff;">00H</span>
<span style="color: #00007f; font-weight: bold;">POP</span> PSW
<span style="color: #00007f; font-weight: bold;">POP</span> A
RETI
<span style="color: #666666; font-style: italic;">;=======延时=======</span>
DELAY1<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> R6<span style="color: #339933;">,</span>#<span style="color: #0000ff;">60</span>
DE1<span style="color: #339933;">:</span> <span style="color: #00007f; font-weight: bold;">MOV</span> R7<span style="color: #339933;">,</span>#<span style="color: #0000ff;">248</span>
<span style="color: #00007f; font-weight: bold;">MOV</span> R7<span style="color: #339933;">,</span>$
DJNZ R6<span style="color: #339933;">,</span>DE1
<span style="color: #00007f; font-weight: bold;">RET</span>
<span style="color: #000000; font-weight: bold;">END</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://xnian.com/2009/07/1564.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>自己修罗技光电高手800套</title>
		<link>http://xnian.com/2009/06/1541.html</link>
		<comments>http://xnian.com/2009/06/1541.html#comments</comments>
		<pubDate>Sat, 20 Jun 2009 15:18:55 +0000</pubDate>
		<dc:creator>纪小年</dc:creator>
				<category><![CDATA[个人记事]]></category>
		<category><![CDATA[电子设计]]></category>
		<category><![CDATA[罗技]]></category>
		<category><![CDATA[键盘]]></category>
		<category><![CDATA[鼠标]]></category>

		<guid isPermaLink="false">http://xnian.com/?p=1541</guid>
		<description><![CDATA[当初配电脑的时候，买的是罗技的光电高手800套装，纯白色的。刚才去看了看，目前都已经停产了。 现在看这款罗技的套装实在是水货到家。当年买这个套装就是冲着他那800DPI的鼠标和罗技的品牌~`只是键盘用几个月后就会发卡发硬，起初我还以为是我冲洗键盘的结果，后来百度了一下，发现很多网友都在反映，随后我也换了双飞燕的套，但罗技100多的价格依然使压在箱底的他时时刺痛我的心灵。 偶然的某一天，鬼使神差的我又把键盘用水洗了一遍，只不过在水里面加了一点凡士林护手液。（凡士林可作润滑剂、绝缘剂、化妆品、药用油膏、浸润等）别说这效果真不错。小键盘都可以玩的起劲舞团了。 今天考完英语四级回来，发现鼠标的左键竟然坏掉了，按一下相当于双击的效果，很不爽。火大了，直接把鼠标给拆了。 发现鼠标坏的地方只是按键部分，让人吃惊的是，那个按键竟然是OMRON欧姆龙的（图片中，后面的座子是我随便找的，前面的那个才是按键）。 既然知道坏在哪里了，那就好办了，随即我又找了一个杂牌鼠标，把它的按键拆到罗技鼠标上面。果然，他被我修好了，O(∩_∩)O哈哈~ OK，以后指不定什么时候还要再拆一遍，实在是太水了……]]></description>
			<content:encoded><![CDATA[<p>当初配电脑的时候，买的是罗技的光电高手800套装，纯白色的。刚才去看了看，目前都已经停产了。<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="logitech0" border="0" alt="logitech0" src="http://xnian.com/wp-content/uploads/2009/06/logitech0.jpg" width="470" height="259" /> </p>
<p>现在看这款罗技的套装实在是水货到家。当年买这个套装就是冲着他那800DPI的鼠标和罗技的品牌~`只是键盘用几个月后就会发卡发硬，起初我还以为是我冲洗键盘的结果，后来百度了一下，发现很多网友都在反映，随后我也换了双飞燕的套，但罗技100多的价格依然使压在箱底的他时时刺痛我的心灵。</p>
<p>偶然的某一天，鬼使神差的我又把键盘用水洗了一遍，只不过在水里面加了一点凡士林护手液。（凡士林可作润滑剂、绝缘剂、化妆品、药用油膏、浸润等）别说这效果真不错。小键盘都可以玩的起劲舞团了。</p>
<p>今天考完英语四级回来，发现鼠标的左键竟然坏掉了，按一下相当于双击的效果，很不爽。火大了，直接把鼠标给拆了。<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="" border="0" alt="" src="http://xnian.com/wp-content/uploads/2009/06/logitech2.jpg" width="470" height="212" /> </p>
<p>发现鼠标坏的地方只是按键部分，让人吃惊的是，那个按键竟然是OMRON欧姆龙的（图片中，后面的座子是我随便找的，前面的那个才是按键）。<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="logitech1" border="0" alt="logitech1" src="http://xnian.com/wp-content/uploads/2009/06/logitech1.jpg" width="260" height="101" /> </p>
<p>既然知道坏在哪里了，那就好办了，随即我又找了一个杂牌鼠标，把它的按键拆到罗技鼠标上面。果然，他被我修好了，O(∩_∩)O哈哈~</p>
<p>OK，以后指不定什么时候还要再拆一遍，实在是太水了……</p>
]]></content:encoded>
			<wfw:commentRss>http://xnian.com/2009/06/1541.html/feed</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
	</channel>
</rss>
