您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 基于FPGA的标准PS-2键盘接口电路设计
、,。,PS/2。,,,I/O,、,,、,[1]。PS/2,,,[2]。PS/2,VerilogHDLFPGAPS/2,,ASCII,PS/2NiosIICPU。,。、PS/21PS/2mini-DIN,PS/2,,1Data(),5Clock(),3,4(5),26。PS/2,,PS/2,,2。1Data2345Clock61PS/2mini-DIN2PS/2、PS/2[3]3PS/2,PS/2,Clock,,,,PS/2。(),(),,。,,,PS/2Data。3PS/220093JOURNALOFNANNINGTEACHERSCOLLEGE26(66):,:200808LX382。:2009-05-10:(1975-),,,,;(1974-),,,,。FPGAPS/2,(,532400):,,PS/2,,PS/2。:PS/2;FPGA;VerilogHDL:IP331.1:A:1008-696X(2009)03-0129-03129··、PS/2PS/2,。,,;,。,:[4]:1,0xF0+。A,0x1C,0xF00x1C。:20xE0+0xXX,0xE0+0xF0+0xXX。rightctrl,0xE00x14,0xE00xF00x14。,printscreen0xE00x120xE00x7C,0xE00xF00x7C0xE00xF00x12;pause0xE10x140x770xE10xF00x140xF00x77,。PS/2,。、PS/2FPGA,PS/2,VerilogHDL:modulekeyb_module(iclk0,//iclk,//Clockidata,///odata,//ASCIIreq,//reset//);inputiclk,iclk0,idata;reset;outputregreq;outputreg[7∶0]odata;reg[3∶0]state;reg[7∶0]mreg;regmreg0,mrege,mregt;regmclk;wire[7∶0]modata;/**************************************/reg[5∶0]cont0;always@(posedgeiclk0)cont0=cont0+1;/***********************/always@(posedgecont0[5])if(!iclk)mclk=0;elsemclk=1;/*******idata(3)******/reg[3∶0]stat0;regm[2∶0];regmd;always@(posedgecont0[5])if(!mclk)case(stat0)0∶beginm[0]=idata;stat0=1;end1:beginm[1]=idata;stat0=2;end2:beginm[2]=idata;stat0=3;end3:beginif(m[0]==m[1]&&m[0]==m[2])beginmd=m[2];stat0=0;endelsestat0=0;enddefault:stat0=0;endcase/*******************************/always@(posedgemclk)begincase(state)0:beginmreg0=idata;state=1;mrege=0;end1:beginif(!mreg0)beginstate=2;mreg[0]=md;endelsestate=0;end2:beginmreg[1]=md;state=3;end3:beginmreg[2]=md;state=4;end4:beginmreg[3]=md;state=5;end5:beginmreg[4]=md;state=6;end6:beginmreg[5]=md;state=7;end7:beginmreg[6]=md;state=8;end8:beginmreg[7]=md;state=9;end9:beginmregt=md;state=10;end10:beginifmrege=md;state=0;enddefault:state=0;endcaseendassignmodata=(mrege)?mreg:8'hzz;,FPGAPS/2130··DesignofFPGA-basedStandardPS/2KeyboardInterfaceCircuitYANGXiu-zheng,LIYun-yu(DepartmentofPhysicsandIT,GuangxiNormalUniversityforNationalities,Longzhou,Guangxi532400,China)Abstract:Keyboardisthekeyinputpartinembeddedsystemandalsothekeymeanofhuman-computerinteraction.Giventheacceptabletechnologyandprice,itispossibletoreplacethescanningmatrixkeyboardwithstandardPS/2keyboard.Keywords:PS/2keyboard;FPGA;VerilogHDL(::)/***ASCII,****/always@(posedgecont0[5]orposedgereset)if(reset)odata=0;elseif(mrege)case(modata)8'h70:odata=8'h30;//08'h69:odata=8'h31;//18'h72:odata=8'h32;//28'h7A:odata=8'h33;//38'h6B:odata=8'h34;//48'h73:odata=8'h35;//58'h74:odata=8'h36;//68'h6C:odata=8'h37;//78'h75:odata=8'h38;//88'h7D:odata=8'h39;//98'h5A:odata=8'h0D;//enter8'h71:odata=8'h7F;//DEL8'h74:odata=8'h74;//8'h75:odata=8'h75;//8'h72:odata=8'h72;//8'h6b:odata=8'h6b;//8'h76:odata=8'h1B;//ECSdefault:odata=8'h00;endcase/*********************************/always@(posedgemregeorposedgereset)if(reset)req=0;elsereq=1;endmodule、,,PS/2,,PS/2。PS/2,FPGAPS/2,PS/2NiosIIASCII,。PS/2NiosIICPU,NiosIIPS/2。,。:[1],,.PS/2PIC[J].,2006(8).[2],.PS/2[J].(),2007(1).[3],.PS/2[J].,2005(1).[4],,.PS/2[J].,2005.,FPGAPS/2131··
本文标题:基于FPGA的标准PS-2键盘接口电路设计
链接地址:https://www.777doc.com/doc-6196280 .html