三種方法讀取鍵值 使用者設(shè)計行列鍵盤介面,一般常採用三種方法讀取鍵值。 中斷式 在鍵盤按下時產(chǎn)生一個外部中斷通知CPU,並由中斷處理程式通過不同位址讀資料線上的狀態(tài)判斷哪個按鍵被按下。 本實驗採用中斷式實現(xiàn)使用者鍵盤介面。 掃描法 對鍵盤上的某一行送低電位,其他為高電位,然後讀取列值,若列值中有一位是低,表明該行與低電位對應(yīng)列的鍵被按下。否則掃描下一行。 反轉(zhuǎn)法 先將所有行掃描線輸出低電位,讀列值,若列值有一位是低表明有鍵按下;接著所有列掃描線輸出低電位,再讀行值。 根據(jù)讀到的值組合就可以查表得到鍵碼。4x4鍵盤按4行4列組成如圖電路結(jié)構(gòu)。按鍵按下將會使行列連成通路,這也是見的使用者鍵盤設(shè)計電路。 //-----------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; //復(fù)位 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
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
表面貼片膠(SMA,surface mount adhesives)用于波峰焊接和回流焊接,以保持組件在印刷電路板(PCB)上的位置,確保在裝配線上傳送過程中組件不會丟失。PCB裝配中使用的大多數(shù)表面貼片膠(SMA)都是環(huán)氧樹脂(epoxies),雖然還有聚丙烯(acrylics)用于特殊的用途。在高速滴膠系統(tǒng)引入和電子工業(yè)掌握如何處理貨架壽命相對較短的產(chǎn)品之后,環(huán)氧樹脂已成為世界范圍內(nèi)的更主流的膠劑技術(shù)。環(huán)氧樹脂一般對廣泛的電路板提供良好的附著力,并具有非常好的電氣性能。
上傳時間: 2013-10-12
上傳用戶:破曉sunshine
這是一本介紹8051的好書,看了這本書能對8051有所了解,本書有介紹指令、timer、interrup、uart幾乎是8051基本的功能都有說明,另外本書也有應(yīng)用電路能讓讀者了解8051。
標簽: 8051
上傳時間: 2013-12-27
上傳用戶:cmc_68289287
用AVR實現(xiàn)軟USB轉(zhuǎn)RS232的全部資料,包含源碼與電路解
上傳時間: 2014-11-23
上傳用戶:tonyshao
altera Quartus II 減法器使用 配合LED,可自動與手動按鈕控製。 (含電路)
上傳時間: 2013-12-13
上傳用戶:王楚楚
altera Quartus II FSM使用 可設(shè)定時間波形,手動調(diào)整波形頻率。 (含電路)
上傳時間: 2016-02-13
上傳用戶:kbnswdifs
altera Quartus II TLC晶片控制 可控制暫存器,手動調(diào)整內(nèi)碼。 (含電路)
上傳時間: 2016-02-13
上傳用戶:Zxcvbnm
altera Quartus II modelSim 自動模擬搭配,內(nèi)有範例。 (含電路)
標簽: modelSim Quartus altera II
上傳時間: 2016-02-13
上傳用戶:lz4v4
關(guān)於宏晶STC89C51單片機IC芯片的詳細資料,內(nèi)有很多簡單電路。
上傳時間: 2013-12-02
上傳用戶:佳期如夢
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1