三種方法讀取鍵值 使用者設計行列鍵盤介面,一般常採用三種方法讀取鍵值。 中斷式 在鍵盤按下時產生一個外部中斷通知CPU,並由中斷處理程式通過不同位址讀資料線上的狀態判斷哪個按鍵被按下。 本實驗採用中斷式實現使用者鍵盤介面。 掃描法 對鍵盤上的某一行送低電位,其他為高電位,然後讀取列值,若列值中有一位是低,表明該行與低電位對應列的鍵被按下。否則掃描下一行。 反轉法 先將所有行掃描線輸出低電位,讀列值,若列值有一位是低表明有鍵按下;接著所有列掃描線輸出低電位,再讀行值。 根據讀到的值組合就可以查表得到鍵碼。4x4鍵盤按4行4列組成如圖電路結構。按鍵按下將會使行列連成通路,這也是見的使用者鍵盤設計電路。 //-----------4X4鍵盤程序--------------// uchar keboard(void) { uchar xxa,yyb,i,key; if((PINC&0x0f)!=0x0f) //是否有按鍵按下 {delayms(1); //延時去抖動 if((PINC&0x0f)!=0x0f) //有按下則判斷 { xxa=~(PINC|0xf0); //0000xxxx DDRC=0x0f; PORTC=0xf0; delay_1ms(); yyb=~(PINC|0x0f); //xxxx0000 DDRC=0xf0; //復位 PORTC=0x0f; while((PINC&0x0f)!=0x0f) //按鍵是否放開 { display(data); } i=4; //計算返回碼 while(xxa!=0) { xxa=xxa>>1; i--; } if(yyb==0x80) key=i; else if(yyb==0x40) key=4+i; else if(yyb==0x20) key=8+i; else if(yyb==0x10) key=12+i; return key; //返回按下的鍵盤碼 } } else return 17; //沒有按鍵按下 }
上傳時間: 2013-11-12
上傳用戶:a673761058
特點 最高輸入頻率 10KHz 計數速度 50/10000脈波/秒可選擇 四種輸入模式可選擇(加算,減算,加減算,90度相位差加減算) 90度相位差加減算具有提高解析度4倍功能 輸入脈波具有預設刻度功能 前置量設定功能(二段設定)可選擇 數位化指撥設定操作簡易 計數暫時停止功能 3組報警功能 2:主要規格 脈波輸入型式: Jump-pin selectable current sourcing(NPN) or current sinking (PNP) 脈波觸發電位: HI bias (CMOS) (VIH=7.5V, VIL=5.5V) LO bias (TTL) (VIH=3.7V, VIL=2.0V) 最高輸入頻率: <10KHz (up,down,up/down mode) <5KHz (quadrature mode) 輸出動作時間 : 0.1 to 99.9 second adjustable 輸出復歸方式: Manual(N) or automatic (R or C) can be modif 繼電器容量: AC 250V-5A, DC 30V-7A 顯示值范圍: -199999 to 999999 顯示幕: Red high efficiency LEDs high 9.2mm (.36") 參數設定方式: Touch switches 感應器電源: 12VDC +/-3%(<60mA) ( 感應器電源 ) 記憶方式: Non-volatile E2PROM memory 絕緣耐壓能力: 2KVac/1 min. (input/output/power) 1600Vdc (input/output) 使用環境條件: 0-50℃(20 to 90% RH non-condensed) 存放環境條件: 0-70℃(20 to 90% RH non-condensed) CE認證: EN 55022:1998/A1:2000 Class A EN 61000-3-2:2000 EN 61000-3-3:1995/A1:2001 EN 55024:1998/A1:2001
上傳時間: 2013-11-12
上傳用戶:909000580
Single-Ended and Differential S-Parameters Differential circuits have been important incommunication systems for many years. In the past,differential communication circuits operated at lowfrequencies, where they could be designed andanalyzed using lumped-element models andtechniques. With the frequency of operationincreasing beyond 1GHz, and above 1Gbps fordigital communications, this lumped-elementapproach is no longer valid, because the physicalsize of the circuit approaches the size of awavelength.Distributed models and analysis techniques are nowused instead of lumped-element techniques.Scattering parameters, or S-parameters, have beendeveloped for this purpose [1]. These S-parametersare defined for single-ended networks. S-parameterscan be used to describe differential networks, but astrict definition was not developed until Bockelmanand others addressed this issue [2]. Bockelman’swork also included a study on how to adapt single-ended S-parameters for use with differential circuits[2]. This adaptation, called “mixed-mode S-parameters,” addresses differential and common-mode operation, as well as the conversion betweenthe two modes of operation.This application note will explain the use of single-ended and mixed-mode S-parameters, and the basicconcepts of microwave measurement calibration.
上傳時間: 2014-03-25
上傳用戶:yyyyyyyyyy
電路板故障分析 維修方式介紹 ASA維修技術 ICT維修技術 沒有線路圖,無從修起 電路板太複雜,維修困難 維修經驗及技術不足 無法維修的死板,廢棄可惜 送電中作動態維修,危險性極高 備份板太多,積壓資金 送國外維修費用高,維修時間長 對老化零件無從查起無法預先更換 維修速度及效率無法提升,造成公司負擔,客戶埋怨 投資大量維修設備,操作複雜,績效不彰
上傳時間: 2013-11-09
上傳用戶:chengxin
利用DSK6711外部,有四個外部中斷埠,可以使用此四個埠,控制內部LED顯示,並於CCS顯示目前中斷是何埠。
上傳時間: 2014-01-04
上傳用戶:Avoid98
這是一個通過mscomm控件的程序,是通過MSCOMM事件來自動檢查串口的數據,並把接受到的數據顯示在指定位置
上傳時間: 2013-12-01
上傳用戶:chens000
這是一本介紹8051的好書,看了這本書能對8051有所了解,本書有介紹指令、timer、interrup、uart幾乎是8051基本的功能都有說明,另外本書也有應用電路能讓讀者了解8051。
標簽: 8051
上傳時間: 2013-12-27
上傳用戶:cmc_68289287
用AVR實現軟USB轉RS232的全部資料,包含源碼與電路解
上傳時間: 2014-11-23
上傳用戶:tonyshao
altera Quartus II 減法器使用 配合LED,可自動與手動按鈕控製。 (含電路)
上傳時間: 2013-12-13
上傳用戶:王楚楚
altera Quartus II FSM使用 可設定時間波形,手動調整波形頻率。 (含電路)
上傳時間: 2016-02-13
上傳用戶:kbnswdifs