DIP
dip 

所属分类:单片机开发
开发工具:C/C++
文件大小:1KB
下载次数:2
上传日期:2010-04-09 16:32:25
上 传 者s19860109
说明:  實驗二:指撥開關控制顯示 一、實驗目的 學習如何規劃8255工作於模式0(Mode 0),利用指撥開關(DIP S.W)作為基本輸入,以控制其輸出。 二、實驗功能 1. 當電腦鍵盤按下“1”時,依指撥開關之設定顯示相對應之LEDs 2. 當電腦鍵盤按下“2”時,依指撥開關所設定中之最高位元,僅顯示相對應之LED。 3. 當電腦鍵盤按下“3”時,依DIP S.W所設定數值之和,以二進制編碼方式顯示於LEDs。 三、基本原理 本實驗乃利用8255完成基本的輸入與輸出功能。首先將8255規劃為模式0,且Port A為輸出,Port C為輸入。並將8個LEDs接至Port A,而將8位元指撥開關接至Port C。 1. 若電腦按鍵選擇“1”, 依指撥開關的調設(ON為低電位,OFF則為高電位),藉由程式讀取Port C,直接將Port C讀取值送至Port A驅動LED顯示。 2. 若電腦按鍵選擇“2”,先將目前指撥開關設定值由Port C讀入,由最高位元逐一遞減判斷是否設定為ON。當發現第一個位元設定為ON,即僅驅動相對應於該位元位置之LED。 3. 若電腦按鍵選擇“3”, 將目前指撥開關設定值由Port C讀入,並逐一累加所有設定為ON的指撥開關位置之相關數值。
(Experiment 2: DIP switch control the display one purpose of the experiment to learn how to plan the 8255 work in the mode 0 (Mode 0), use DIP switch (DIP SW) as the basic input to control the output. Second, experimental features 1. When the computer keyboard by pressing the " 1" , according to the setting of DIP switch corresponds to the display LEDs 2. When the computer keyboard by pressing the " 2" when the DIP switch according to the highest bit set in only shows the corresponding LED. 3. When the computer keyboard by pressing " 3" , the value set by DIP SW s and, in binary encoding shown in the LEDs.)

文件列表:
DIP.c (2676, 2010-04-09)

近期下载者

相关文件


收藏者