{"id":7326,"date":"2024-10-02T14:47:31","date_gmt":"2024-10-02T06:47:31","guid":{"rendered":"http:\/\/www.hellofpga.com\/?p=7326"},"modified":"2024-10-09T12:54:44","modified_gmt":"2024-10-09T04:54:44","slug":"lemon_zynq_key","status":"publish","type":"post","link":"http:\/\/www.hellofpga.com\/index.php\/2024\/10\/02\/lemon_zynq_key\/","title":{"rendered":"\u57fa\u4e8eLemon ZYNQ\u7684FPGA\u5b9e\u9a8c\u4e09 PL\u90e8\u5206\u6309\u952e\u529f\u80fd\u6f14\u793a\uff08IO\u8f93\u5165\u529f\u80fd\uff09"},"content":{"rendered":"\n<p>\u672c\u7ae0\u4ecb\u7ecd\u5982\u679c\u8bfb\u53d6\u6309\u952e\u7684\u64cd\u4f5c\uff0c\u6765\u6f14\u793aPL\u90e8\u5206\u7684IO\u8f93\u5165\u529f\u80fd\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6b64\u7ae0\u8282\u5185\u5bb9\u9002\u7528\u4e8eLemon ZYNQ\u4e3b\u677f\uff0c\u5982\u662f\u5176\u4ed6\u677f\u5b50\u8bf7\u770b\u5bf9\u5e94\u677f\u5b50\u76ee\u5f55<\/strong>\u3002<\/li>\n\n\n\n<li><strong>\u672c\u6587\u5728 vivado2018.3\u7248\u672c\u4e0a\u6f14\u793a<\/strong>\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001\u786c\u4ef6\u4ecb\u7ecd<\/strong><\/h2>\n\n\n\n<p>\u5148\u770b\u539f\u7406\u56fe\uff0c\u7531\u539f\u7406\u56fe\u53ef\u4ee5\u770b\u51fa\u677f\u5b50\u4e0a\u63a5\u4e86\u56db\u4e2a\u6309\u952e\uff0c\u5e76\u4e14\u9ed8\u8ba4\u662f\u901a\u8fc7\u4e0b\u62c9\u7535\u963b\u4e0b\u62c9\u5230GND\u7684\uff0c\u4e5f\u5c31\u662f\u5f53\u6309\u952e\u6ca1\u6709\u6309\u4e0b\u7684\u65f6\u5019 \u6309\u952eKEY \u7684\u4fe1\u53f7\u811a\u662f0V \uff0c\u5f53\u6309\u952e\u6309\u4e0b\u540e\uff0c\u8be5\u4fe1\u53f7\u811a\u88ab\u62c9\u9ad8\u52303.3V \u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"478\" height=\"451\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-11.png\" alt=\"\" class=\"wp-image-7327\" style=\"width:346px;height:auto\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-11.png 478w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-11-300x283.png 300w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><\/figure>\n\n\n\n<p>\u4e3a\u4e86\u6f14\u793a\u6309\u952e\u7684\u529f\u80fd\uff0c\u8fd9\u91cc\u518d\u5728\u5de5\u7a0b\u4e2d\u5f15\u5165LED\u6307\u793a\u706f\uff0c\u6307\u793a\u706f\u4e4b\u524d\u7ae0\u8282\u7684\u4f8b\u5b50\u91cc\u6d4b\u8bd5\u8fc7\uff0c\u5c06LED\u7684\u9a71\u52a8\u811a\u62c9\u9ad8\uff0c\u6307\u793a\u706f\u4eae\uff0c\u62c9\u4f4e\u6307\u793a\u706f\u7184\u706d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"348\" height=\"387\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-12.png\" alt=\"\" class=\"wp-image-7328\" style=\"width:320px;height:auto\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-12.png 348w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/image-12-270x300.png 270w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/figure>\n\n\n\n<p><strong>\u4e3a\u4e86\u65b9\u4fbf\u4ee3\u7801\u7684\u6f14\u793a\uff0c\u8fd9\u91cc\u4ec5\u7528\u4e24\u4e2a\u6309\u952e\uff0c\u548c\u4e24\u4e2aLED\u8fdb\u884c\u6d4b\u8bd5<\/strong>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u5de5\u7a0b\u521b\u5efa<\/strong><\/h2>\n\n\n\n<p>\u5de5\u7a0b\u521b\u5efa\u7684\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u8003\u8bd5\u9a8c\u4e00\u4e2d\u7684\u5185\u5bb9\uff0c\u8fd9\u91cc\u4e0d\u8be6\u7ec6\u63cf\u8ff0\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e09\u3001\u4ee3\u7801\u7684\u7f16\u5199<\/strong><\/h2>\n\n\n\n<p>\u6b63\u5e38\u7684\u6309\u952e\u64cd\u4f5c\uff0c\u5728\u6309\u4e0b\u77ac\u95f4 \u7535\u5e73\u4f1a\u4ea7\u751f\u6296\u52a8\uff0c\u867d\u8bf4\u53ea\u662f\u4e00\u4e2a\u6309\u4e0b\u7684\u64cd\u4f5c\uff0c\u4f46\u662f\u5b9e\u9645\u53ef\u80fd\u7535\u538b\u8df3\u53d8\u4e86\u65e0\u6570\u6b21\uff0c\u6240\u4ee5\u6b63\u5e38\u7684\u6309\u952e\u4ee3\u7801\u662f\u9700\u8981\u6d88\u6296\u7684\uff0c\u6d88\u6296\u4f1a\u7a0d\u5fae\u9ebb\u70e6\u70b9 \u8fd9\u91cc\u653e\u5230\u672c\u6587\u7684\u6700\u540e\u518d\u4ecb\u7ecd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1 \uff09\u4e0d\u5e26\u6d88\u6296\u7684\u7a0b\u5e8f\u6f14\u793a <\/strong><\/h2>\n\n\n\n<p><strong>\u4e3a\u4e86\u65b9\u4fbf\u7406\u89e3\u8f93\u5165\u8f93\u51fa\u7684\u6982\u5ff5\u8fd9\u91cc\u5148\u7b80\u5355\u5199\u4e00\u4e2a\u4e0d\u5e26\u6d88\u6296\u7684\u6309\u952e\uff0c\u53bb\u63a7\u5236LED\u706f\u7684\u7a0b\u5e8f<\/strong>\uff08\u4e00\u822c\u82af\u7247\u95f4\u7684\u901a\u8baf\u662f\u4e0d\u9700\u8981\u505a\u6d88\u6296\u529f\u80fd\u7684\uff0c\u53ea\u6709\u6309\u952e\u4e4b\u7c7b\u7684\u624d\u9700\u8981\u505a\u6d88\u6296\uff09\u3002<\/p>\n\n\n\n<p>\u9996\u5148 \u539f\u5148 LED \u7684\u9a71\u52a8\u7a0b\u5e8f\uff0c\u6211\u4eec\u7528\u7684\u662foutput \uff0coutput\u4ee3\u8868\u8f93\u51fa\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u7684\u6309\u952e\u8981\u8bbe\u7f6e\u6210input \uff0c\u4ee3\u8868\u8f93\u5165\u3002<\/p>\n\n\n\n<p>\u5b8c\u6574\u4ee3\u7801\u6bd4\u8f83\u7b80\u5355 \u5c31\u4e0d\u8be6\u7ec6\u63cf\u8ff0\u4e86\uff0c\u8be6\u7ec6\u89c1\u4e0b\u9762<\/p>\n\n\n\n<p>\u7a0b\u5e8f\u662f\u901a\u8fc7\u65f6\u949f\u4fe1\u53f7\u540c\u6b65\u7684<strong>\u65f6\u5e8f\u903b\u8f91<\/strong>\u7684\u65b9\u5f0f\u6765\u8fd0\u884c\uff0c\u5176\u4e2dLED\u706f\u7684\u53d8\u5316 \u548c KEY\u7684\u53d8\u5316\u4ec5\u5728clk \u7684\u4e0a\u5347\u6cbf\u5b8c\u6210\uff0c\u53d7\u65f6\u949f\u5f71\u54cd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">`timescale 1ns \/ 1ps<br>module KEY_TEST(<br>    input clk,<br>    output  LED1,<br>    output  LED2,<br>    input KEY1,<br>    input KEY2<br>);<br><br>reg LED1_r=0;<br>reg LED2_r=0;<br><br>always@(posedge clk)begin<br>    if(KEY1==1)LED1_r&lt;=1'b1;<br>    else LED1_r&lt;=1'B0;<br>   <br>    if(KEY2==1)LED2_r&lt;=1'b1;<br>    else LED2_r&lt;=1'B0;<br>end<br><br>assign LED1=LED1_r;<br>assign LED2=LED2_r;<br><br>endmodule<\/pre>\n\n\n\n<p>\u7ea6\u675f\u6587\u4ef6\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">set_property PACKAGE_PIN R14 [get_ports LED1]<br>set_property PACKAGE_PIN P14 [get_ports LED2]<br>set_property PACKAGE_PIN D19 [get_ports KEY1]<br>set_property PACKAGE_PIN D20 [get_ports KEY2]<br>set_property PACKAGE_PIN H16 [get_ports clk]<br>set_property IOSTANDARD LVCMOS33 [get_ports LED1]<br>set_property IOSTANDARD LVCMOS33 [get_ports LED2]<br>set_property IOSTANDARD LVCMOS33 [get_ports KEY1]<br>set_property IOSTANDARD LVCMOS33 [get_ports KEY2]<br>set_property IOSTANDARD LVCMOS33 [get_ports clk]<\/pre>\n\n\n\n<p><strong>\u4fdd\u5b58\u540e\u8fdb\u884c\u7f16\u8bd1\u548c\u7efc\u5408\uff0c\u6700\u540e\u4e0b\u8f7d\u5230\u677f\u5b50\u4e0a\u8fdb\u884c\u8fd0\u884c\uff0c\u53ef\u4ee5\u770b\u5230\u5f53\u6309\u4e0bBTN0\u7684\u6309\u952e\u540e\uff0c\u5de6\u8fb9\u7684\u706fLD0\u88ab\u70b9\u4eae\uff0c\u5f53\u6309\u4e0b\u53f3\u8fb9BTN1\u7684\u6309\u952e\u540e\uff0c\u53f3\u8fb9\u7684\u706fLD2\u88ab\u70b9\u4eae\u4e86<\/strong>\u3002<\/p>\n\n\n\n<p>\u5230\u8fd9\u91cc\u7b80\u5355\u7684\u8f93\u5165\u529f\u80fd\u4ecb\u7ecd\u5b8c\u6bd5\u4e86\u3002<\/p>\n\n\n\n<p>\u6309\u952e\u63a7\u5236\u4e5f\u53ef\u4ee5\u662f\u7ec4\u5408\u903b\u8f91\uff0cLED\u706f\u7684\u72b6\u6001\u4ec5\u548c\u6309\u952e\u6709\u5173\u548c\u65f6\u949f\u7b49\u6ca1\u6709\u5173\u7cfb\uff0c\u8fd9\u79cd\u65b9\u5f0f\u5c31\u76f8\u5f53\u4e8eFPGA\u5185\u90e8\u62c9\u4e86\u4e2a\u5bfc\u7ebf\u5e76\u4e32\u4e86\u4e2a\u975e\u95e8\u5230LED\u548c\u6309\u952e\u4e4b\u95f4\u3002<\/p>\n\n\n\n<p>LED1=(KEY1==1)?1\u2019b1:1\u2019b0;<\/p>\n\n\n\n<p><strong>\u8fd9\u79cd\u65b9\u5f0f \u4e5f\u4e0d\u9700\u8981\u521b\u5efaLED\u5bf9\u5e94\u7684 REG\u5bc4\u5b58\u5668\uff08LED_r\uff09\u7f3a\u70b9\u662f\u5404\u4e2a\u4fe1\u53f7\u95f4\u4e0d\u540c\u6b65 \u4e0d\u9002\u7528\u4e8e\u5927\u578b\u7cfb\u7edf\u4e2d<\/strong>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2\uff09\u5e26\u6d88\u6296\u7684\u7a0b\u5e8f\u6f14\u793a <\/strong><\/h2>\n\n\n\n<p><strong>\u4ee5\u4e0a\u4ecb\u7ecd\u7684\u65b9\u6cd5\u4e0d\u5e26\u6309\u952e\u6d88\u6296\uff0c\u9002\u7528\u4e8e\u4e0d\u540c\u82af\u7247\u95f4\u4f20\u8f93\uff0c\u548c\u7b80\u5355\u7684\u6309\u952e\u5e94\u7528\uff0c \u5982\u679c\u8981\u8ba9\u7cfb\u7edf\u4e2d\u6309\u952e\u7684\u7a33\u5b9a\u6027\u66f4\u5927\uff0c\u90a3\u9700\u8981\u5728\u7cfb\u7edf\u4e2d\u989d\u5916\u589e\u52a0\u6309\u952e\u6d88\u6296\u529f\u80fd<\/strong>\u3002<\/p>\n\n\n\n<p>\u6309\u952e\u6d88\u6296\u7684\u539f\u7531\uff1a\u901a\u5e38\u5728\u4e00\u4e2a\u6309\u952e\u5f00\u5173\u5728\u95ed\u5408\u65f6\u7531\u4e8e\u673a\u68b0\u7279\u6027\u7684\u539f\u56e0\uff0c\u6309\u952e\u4e0d\u4f1a\u7acb\u9a6c\u63a5\u901a\uff0c\u5728\u65ad\u5f00\u65f6\u4e5f\u4e0d\u4f1a\u4e00\u4e0b\u5b50\u65ad\u5f00\uff0c\u800c\u662f\u5728\u95ed\u5408\u53ca\u65ad\u5f00\u7684\u77ac\u95f4\u5747\u4f34\u968f\u6709\u591a\u6b21\u6296\u52a8\uff0c\u6296\u52a8\u7684\u4ea7\u751f\u4f1a\u5bf9\u6309\u952e\u7684\u4fe1\u53f7\u672c\u8eab\u4ea7\u751f\u5e72\u6270\u3002<\/p>\n\n\n\n<p>\u4e00\u822c\u6b63\u5e38\u6309\u952e \u6296\u52a8\u8fc7\u7a0b\u662f\u5c0f\u4e8e20ms\u7684\uff0c \u800c\u6b63\u5e38\u7684\u4e00\u6b21\u6309\u952e\u64cd\u4f5c\uff0c\u5373\u4f7f\u662f\u77ed\u6309\u65f6\u95f4\u4e5f\u90fd\u662f\u8d85\u8fc750ms\u7684\u3002 \u6240\u4ee5\u6211\u4eec\u7684\u6309\u952e\u6d88\u6296\u65f6\u95f4\u53ef\u4ee5\u4ee520ms\u4f5c\u4e3a\u754c\u9650\u3002<\/p>\n\n\n\n<p><strong>\u6309\u952e\u6d88\u6296\u7684\u601d\u8def<\/strong>\uff1a<\/p>\n\n\n\n<p>a.\u521d\u59cb\u72b6\u6001 \u8ba1\u6570\u5668\u4e3a0\uff0c\u8df3\u8f6c\u5230\u72b6\u6001b\u3002<\/p>\n\n\n\n<p>b.\u68c0\u6d4b\u5230\u6309\u952e\u6309\u4e0b\uff08\u5373\u7535\u5e73\u4e3a1\uff09\u8ba1\u6570\u5668\u5f00\u59cb\u8ba1\u65f6 \uff0c\u8df3\u8f6c\u5230\u72b6\u6001c\u3002<\/p>\n\n\n\n<p>c.\u8ba1\u6570\u5668\u8ba1\u6570\u523020ms\u524d\u4e0d\u505c\u7684\u68c0\u6d4b\uff0c\u68c0\u6d4b\u5230\u7535\u538b\u503c\u4e0d\u4e3a1\uff0c\u5373\u8ba4\u4e3a\u662f\u6296\u52a8\u4fe1\u53f7\uff0c\u5219\u7cfb\u7edf\u56de\u5230a\u521d\u59cb\u72b6\u6001\uff0c\u5982\u679c20ms\u5185\u7535\u538b\u503c\u65f6\u949f\u4e3a1\uff0c\u5219\u8ba4\u4e3a\u6309\u952e\u6709\u6548\uff0c\u8df3\u8f6c\u5230\u72b6\u6001d\u3002<\/p>\n\n\n\n<p>d.\u6309\u952e\u6709\u6548\u4fe1\u53f7\u7f6e\u4f4d \uff0c \u5f53\u68c0\u6d4b\u5230\u6309\u952e\u7535\u5e73\u4e0d\u4e3a1\u65f6\uff0c \u6309\u952e\u6709\u6548\u4fe1\u53f7\u6e050\u3002<\/p>\n\n\n\n<p>\uff08\u4ee5\u4e0a\u662f\u5224\u65ad\u6309\u952e\u6309\u4e0b\u7684\u6d88\u6296\u5904\u7406\u601d\u8def\uff0c \u5982\u679c\u91ca\u653e\u6309\u952e\u4e0d\u53c2\u4e0e\u51b3\u7b56\uff0c\u5219\u4e0d\u9700\u8981\u505a\u6309\u952e\u91ca\u653e\u6d88\u6296\uff0c\u5426\u5219 \u6309\u952e\u91ca\u653e\u4e5f\u9700\u8981\u505a\u6d88\u6296\u5904\u7406\uff09\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u5f00\u59cb\u5199\u6d88\u6296\u7684\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br>\/\/www.hellofpga.com\/\/<br>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<br>`timescale 1ns \/ 1ps<br>module KEY_TEST(<br>    input clk,<br>    output LED,<br>    input KEY<br>);<br><br>reg [1:0]debounce_mode=2'd0;<br>reg [21:0]debounce_count=22'd0;<br><br>reg [1:0]KEY_r=0;<br>always@(posedge clk)begin<br>    KEY_r[1]&lt;= KEY_r[0];<br>    KEY_r[0]&lt;= KEY;<br>end<br>wire KEY_POSEDGE=(~KEY_r[1]&amp;KEY_r[0])?1'b1:1'b0;<br><br><br>reg KEY_value=0;<br>always@(posedge clk)begin<br>    if(debounce_mode==0)begin<br>        debounce_count&lt;=22'd0;<br>        debounce_mode&lt;=2'd1;<br>        KEY_value&lt;=0;<br>    end<br>    else if(debounce_mode==1)begin<br>        if(KEY_POSEDGE==1)begin<br>            debounce_count&lt;=22'd0;<br>            debounce_mode&lt;=2'd2;<br>        end<br>    end<br>    else if(debounce_mode==2)begin<br>        if(debounce_count&gt;=22'd2_500_000)debounce_mode&lt;=2'd3;<br>        else begin<br>            if(KEY==0)debounce_mode&lt;=2'd0;<br>            debounce_count&lt;=debounce_count+1'b1;<br>        end <br>    end<br>    else begin<br>        if(KEY==0)debounce_mode&lt;=2'd0;<br>        KEY_value&lt;=1'b1;<br>    end<br>end<br><br>assign LED=KEY_value;<br><br>endmodule<\/pre>\n\n\n\n<p><strong>\u4ee3\u7801\u7b80\u5355\u89e3\u8bfb<\/strong><\/p>\n\n\n\n<p>\u4ee3\u7801\u91cc\u7528\u4e86\u4e24\u4f4d\u5bc4\u5b58\u5668\u6765\u79fb\u4f4dKEY\u7684\u6309\u952e\u72b6\u6001\uff0c\u7136\u540e\u901a\u8fc7\u5bf9\u6bd4\u524d\u540e\u7684\u6309\u952e\u53d8\u5316\u6765\u627e\u5230\u6309\u952e\u7684\u4e0a\u5347\u6cbf\uff08\u4e0a\u4e2a\u65f6\u523b\u662f\u4f4e\u7535\u5e73\uff0c\u4e0b\u4e2a\u65f6\u523b\u4e3a\u9ad8\u7535\u5e73\uff0c\u4ee3\u8868\u662f\u4e0a\u5347\u6cbf\uff0c\u5373(~KEY_r[1]&amp;KEY_r[0])\uff09\uff0c\u5f53\u7cfb\u7edf\u4e3a\u4e0a\u5347\u7684\u90a3\u4e2a\u65f6\u523bKEY_POSEDGE\u8f93\u51fa\u9ad8\u7535\u5e73\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">reg [1:0]KEY_r=0;<br>always@(posedge clk)begin<br>    KEY_r[1]&lt;= KEY_r[0];<br>    KEY_r[0]&lt;= KEY;<br>end<br>wire KEY_POSEDGE=(~KEY_r[1]&amp;KEY_r[0])?1'b1:1'b0;<\/pre>\n\n\n\n<p>debounce_mode\u4ee3\u8868\u5f53\u524d\u7684\u72b6\u6001\u673a\u6240\u5904\u7684\u72b6\u6001\uff0c\u5176\u4e2d\u76840\uff0c1\uff0c2\uff0c3\u5206\u522b\u4ee3\u8868\u524d\u9762\u5199\u7684\u6309\u952e\u6d88\u6296\u601d\u8def\u7684a,b,c,d4\u4e2a\u8fc7\u7a0b\u6b65\u9aa4\uff0c\u8fd9\u91cc\u53ef\u4ee5\u5bf9\u5e94\u7740\u770b\u3002 0\u4ee3\u8868\u521d\u59cb\u5316\uff0c1\u6a21\u5f0f\u68c0\u6d4b\u4e0a\u5347\u6cbf\uff0c\u5982\u679c\u51fa\u73b0\u4e0a\u5347\u6cbf\u8fdb\u5165\u5230\u6a21\u5f0f2\uff0c2\u5f00\u59cb\u8ba1\u6570\u5e76\u68c0\u6d4b\u6309\u952e\u72b6\u6001\u662f\u5426\u53d8\u62100\uff0c\u5982\u679c\u662f\u5219\u8ba4\u4e3a\u89e6\u53d1\u7684\u662f\u6296\u52a8\u5e72\u6270\uff0c\u5219\u91cd\u65b0\u56de\u5230\u6a21\u5f0f0\u7b49\u5f85\u4e0b\u4e00\u4e2a\u4e0a\u5347\u6cbf\uff0c\u5982\u679c\u8ba1\u6570\u5668\u8d85\u8fc720ms\u6309\u952e\u65f6\u949f\u6ca1\u53d8\u5316\uff0c\u5219\u8ba4\u4e3a\u6309\u952e\u6709\u6548\u8fdb\u5165\u6a21\u5f0f3\uff0c\u6a21\u5f0f3\u4e0b\u6539\u53d8\u6309\u952e\u7684\u8f93\u51fa\u503cKEY_value\u3002<\/p>\n\n\n\n<p>debounce_count\u662f\u4e00\u4e2a22\u4f4d\u7684\u8ba1\u6570\u5668\uff0c\u4ece\u6309\u952e\u7684\u4e0a\u5347\u6cbf\u5f00\u59cb \u8ba1\u6570\uff0c\u76f4\u523020ms\u505c\u6b62\uff0820ms \u5bf9\u5e94125mhz\u65f6\u949f\u7684\u7b2c2500000\u4e2a\u8109\u51b2\uff09\u3002<\/p>\n\n\n\n<p>KEY_value\u4ee3\u8868\u6700\u7ec8\u6d88\u6296\u540e\u7684\u6309\u952e\u503c\uff0cKEY_value=1\u4ee3\u8868\u6309\u952e\u6709\u6548 \u5e76\u4e14\u4e00\u76f4\u6301\u7eed\u3002 \u8fd9\u91cc\u5c06\u6309\u952e\u7684\u7ed3\u679c\u901a\u8fc7assign LED=KEY_value; \u5c06KEY_value\u5bc4\u5b58\u5668\u7684\u503c\u76f4\u63a5\u6620\u5c04\u5230LED\u6307\u793a\u706f\u4e0a\uff0c\u53ef\u4ee5\u66f4\u597d\u7684\u770b\u5230\u6309\u952e\u6309\u4e0b\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u589e\u52a0\u7ea6\u675f\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">set_property PACKAGE_PIN R14 [get_ports LED]<br>set_property PACKAGE_PIN D19 [get_ports KEY]<br>set_property PACKAGE_PIN H16 [get_ports clk]<br>set_property IOSTANDARD LVCMOS33 [get_ports LED]<br>set_property IOSTANDARD LVCMOS33 [get_ports KEY]<br>set_property IOSTANDARD LVCMOS33 [get_ports clk]<\/pre>\n\n\n\n<p>\u8fd9\u91cc\u53ea\u6f14\u793a\u4e00\u4e2a\u6309\u952e\uff0c\u5982\u679c\u8981\u505a\u591a\u4e2a\u6309\u952e\uff0c\u53ef\u4ee5\u7528\u6a21\u5757\u4f8b\u5316\u7684\u65b9\u5f0f \u8bbe\u8ba1\u591a\u4e2a\u6309\u952e\uff0c\u8fd9\u91cc\u8bf7\u81ea\u884c\u5c1d\u8bd5\u3002\u5982\u679c\u9700\u8981\u589e\u52a0\u6309\u952e\u91ca\u653e\u6d88\u6296\uff0c\u539f\u7406\u4e0a\u76f8\u901a\uff0c\u53ef\u81ea\u884c\u7814\u7a76\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u672c\u6587\u7684\u5b8c\u6574\u5de5\u7a0b\u4e0b\u8f7d\uff1a<a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2024\/10\/03_PL_KEY.zip\">03_PL_KEY<\/a><\/strong><\/li>\n\n\n\n<li><strong>VIVADO\u7684\u7248\u672c\uff1a2018.3<\/strong><\/li>\n\n\n\n<li><strong>\u5de5\u7a0b\u521b\u5efa\u76ee\u5f55\uff1a E:\\Lemon_ZYNQ\\FPGA\\03_PL_KEY  \u5176\u4e2d\u4e0d\u5e26\u6d88\u6296\u7684\u662fKEY_TEST\u76ee\u5f55\uff0c\u5e26\u6d88\u6296\u7684\u662fKEY_TEST_DEBOUNCE\u76ee\u5f55<\/strong><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7ae0\u4ecb\u7ecd\u5982\u679c\u8bfb\u53d6\u6309\u952e\u7684\u64cd\u4f5c\uff0c\u6765\u6f14\u793aPL\u90e8\u5206\u7684IO\u8f93\u5165\u529f\u80fd<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-7326","post","type-post","status-publish","format-standard","hentry","category-lemon-zynq"],"views":848,"_links":{"self":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/7326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/comments?post=7326"}],"version-history":[{"count":12,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/7326\/revisions"}],"predecessor-version":[{"id":7765,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/7326\/revisions\/7765"}],"wp:attachment":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/media?parent=7326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/categories?post=7326"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/tags?post=7326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}