?? 常用接口電路及其編程.htm
字號:
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">進入其內部。在給出了</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">8</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">個脈沖后,最先進入</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的第一個數據到達了最高位,然后再來一個脈沖會有什么發生呢?再來一個脈沖,第一個脈沖就會從最高位移出,就象車站排隊買票,欄桿就那么長,要從后面進去一個人,前面必須要從前面走出去一個人才行。</SPAN></P>
<P><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">搞清了這一點,下面讓我們來看電路,</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">6</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">7LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">首尾相串,而時鐘端則接在一起,這樣,當輸入</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">8</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">個脈沖時,從單片機</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">RXD</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">端輸出的數據就進入到了第一片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中了,而當第二個</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">8</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">個脈沖到來后,這個數據就進入了第二片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,而新的數據則進入了第一片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,這樣,當第六個</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">8</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">個脈沖完成后,首次送出的數據被送到了最左面的</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中,其他數據依次出現在第一、二、三、四、五片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中。有個問題,在第一個脈沖到來時,除了第一片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中接收數據外,其他各片在干嗎呢?它們也在接收數據,因為它們的時鐘端都是被接在一起的,可是數據還沒有送到其他各片呢,它們在接收什么數據呢?。。。。。。其實所謂數據不過是一種說法而已,實際就是電平的高低,當第一個脈沖到來時,第一片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">固然是從單片機接收數據了,而其它各片也接到前一片的</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">Q8</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上,而</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">Q8</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是一根電線,在數字電路中它只可能有兩種狀態:低電平或高電平,也就是</SPAN><SPAN
lang=EN-US>“</SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">0</SPAN><SPAN
lang=EN-US>”</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN
lang=EN-US>“</SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">1</SPAN><SPAN
lang=EN-US>”</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。所以它的下一片</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">74LS164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也相當于是在接收數據啊。只是接收的全部是</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">0</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">1</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而已。這個問題放在這兒說明,可能有朋友不屑一顧,而有的朋友可能還是不清楚,這實際上涉及到數的本質的問題,如果不懂的,請仔細思考,并找一些數字電路的數,理解</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">164</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的工作原理,再來看這個問題,或者去看看我的另一篇文章《初學單片機易掌握的概念》。務必搞懂,搞懂了這一點,你的級別就高過初學者,可謂入門者了。</SPAN><SPAN
lang=EN-US><IMG height=222 id=_x0000_i1026 src="常用接口電路及其編程.files/dpj252.gif"
width=582></SPAN></P>
<P><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">入口:把要顯示的數分別放在顯示緩沖區</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">60H-65H</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">共</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">6</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">個單元中,并且分別對應各個數碼管</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">LED0-LED5</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN></P>
<P><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">出口:將預置在顯示緩沖區中的</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">6</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">個數成相應的顯示字形碼,然后輸出到顯示器中顯示。</SPAN></P>
<P><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">顯示程序如下:</SPAN></P>
<P><SPAN lang=EN-US style="FONT-FAMILY: System">DISP:<SPAN
style="mso-tab-count: 1"> </SPAN>MOV<SPAN style="mso-tab-count: 1">
</SPAN>SCON,#00H</SPAN><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">初始化串行口方式</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">0</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">MOV<SPAN
style="mso-tab-count: 1"> </SPAN>R1,#06H</SPAN><SPAN lang=EN-US><SPAN
style="mso-tab-count: 3">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">顯示</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: System">6</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">位數</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">MOV<SPAN
style="mso-tab-count: 1"> </SPAN>R0,#65H</SPAN><SPAN lang=EN-US><SPAN
style="mso-tab-count: 3">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;60H-65H</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">為顯示緩沖區</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">MOV<SPAN
style="mso-tab-count: 1"> </SPAN>DPTR,#SEGTAB</SPAN><SPAN lang=EN-US><SPAN
style="mso-tab-count: 1">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">字形表的入口地址</SPAN></P>
<P><SPAN lang=EN-US style="FONT-FAMILY: System">LOOP:<o:p></o:p></SPAN></P>
<P><SPAN lang=EN-US style="FONT-FAMILY: System"><SPAN
style="mso-tab-count: 2">
</SPAN>MOV<SPAN style="mso-tab-count: 1"> </SPAN>A,@R0</SPAN><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 3">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">取最高位的待顯示數據</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">MOVC<SPAN
style="mso-tab-count: 1"> </SPAN>A,@A+DPTR</SPAN><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">查表獲取字形碼</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">MOV<SPAN
style="mso-tab-count: 1"> </SPAN>SBUF,A</SPAN><SPAN lang=EN-US><SPAN
style="mso-tab-count: 3">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">送串口顯示</SPAN></P>
<P><SPAN lang=EN-US style="FONT-FAMILY: System">DELAY:<SPAN
style="mso-tab-count: 1"> </SPAN>JNB<SPAN
style="mso-tab-count: 2"> </SPAN>TI,DELAY</SPAN><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等待發送完畢</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">CLR<SPAN
style="mso-tab-count: 2"> </SPAN>TI</SPAN><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 4">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">清發送標志</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">DEC<SPAN
style="mso-tab-count: 2"> </SPAN>R0</SPAN><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 4">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指針下移一位,準備取下一個待顯示數</SPAN></P>
<P><SPAN lang=EN-US><SPAN
style="mso-tab-count: 2">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">DJNZ<SPAN
style="mso-tab-count: 1"> </SPAN>R1,LOOP</SPAN><SPAN
lang=EN-US><SPAN
style="mso-tab-count: 3">
</SPAN></SPAN><SPAN lang=EN-US style="FONT-FAMILY: System">;</SPAN><SPAN
style="FONT-FAMILY: 宋體; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">直到</SPAN><SPAN
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -