{"id":2476,"date":"2023-01-18T13:49:40","date_gmt":"2023-01-18T05:49:40","guid":{"rendered":"http:\/\/www.hellofpga.com\/?p=2476"},"modified":"2023-01-18T13:49:40","modified_gmt":"2023-01-18T05:49:40","slug":"smart-zynq_key_test","status":"publish","type":"post","link":"http:\/\/www.hellofpga.com\/index.php\/2023\/01\/18\/smart-zynq_key_test\/","title":{"rendered":"Smart ZYNQ\u677f \u5de5\u7a0b\u56db 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<\/p>\n\n\n\n<p>\u672c\u6587\u5728 vivado2018.3\u7248\u672c\u4e0a \u6f14\u793a\uff0c \u5176\u4ed6\u7248\u672c\u8bf7\u81ea\u884c\u7814\u7a76<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. \u786c\u4ef6\u4ecb\u7ecd<\/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\u4e24\u4e2a\u6309\u952e\uff0c\u5e76\u4e14\u9ed8\u8ba4\u662f\u901a\u8fc7\u4e0a\u62c9\u7535\u963b\u4e0a\u62c9\u52303.3V\u7684\uff0c\u4e5f\u5c31\u662f\u5f53\u6309\u952e\u6ca1\u6709\u6309\u4e0b\u7684\u65f6\u5019 \u6309\u952eKEY \u7684\u4fe1\u53f7\u811a\u662f3.3V \uff0c\u5f53\u6309\u952e\u6309\u4e0b\u540e\uff0c\u8be5\u4fe1\u53f7\u811a\u88ab\u62c9\u4f4e\u5230GND\u4e5f\u5c31\u662f0V \u540c\u6837\u4e5f\u80fd\u770b\u51fa \u4e24\u4e2a\u6309\u952e\u5206\u522b\u8fde\u63a5\u5230\u4e86 FPGA\u82af\u7247\u7684 G17\u548cG18\u7ba1\u811a\u4e0a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"418\" height=\"301\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-63.png\" alt=\"\" class=\"wp-image-2478\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-63.png 418w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-63-300x216.png 300w\" sizes=\"auto, (max-width: 418px) 100vw, 418px\" \/><\/figure>\n\n\n\n<p>\u4e3a\u4e86\u6f14\u793a\u4e24\u4e2a\u6309\u952e\u7684\u529f\u80fd\uff0c\u8fd9\u91cc\u518d\u5f15\u5165\u4e24\u4e2a\u6307\u793a\u706f\uff0c\u6307\u793a\u706f\u4e4b\u524d3\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\uff0c\u6307\u793a\u706f\u5206\u522b\u63a5\u5728\u4e3b\u82af\u7247\u7684K16\u548cJ16\u811a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"311\" height=\"303\" src=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-64.png\" alt=\"\" class=\"wp-image-2480\" srcset=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-64.png 311w, http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/image-64-300x292.png 300w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u4ee3\u7801\u7684\u7f16\u5199<\/h2>\n\n\n\n<p>\u5b8c\u6574\u7684\u5de5\u7a0b\u521b\u5efa\u524d\u9762\u5df2\u7ecf\u8be6\u7ec6\u56fe\u6587\u63cf\u5199\u4e86\uff0c\u8fd9\u91cc\u7565\u8fc7\uff0c\u76f4\u63a5\u4ecb\u7ecd\u7a0b\u5e8f\u3002<\/p>\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<\/p>\n\n\n\n<p>2.1&nbsp;<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\u624d\u9700\u8981\u505a\u6d88\u6296\uff09<\/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<\/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<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">`timescale 1ns \/ 1ps\nmodule KEY_TEST(\n    input clk,\n    output  LED1,\n    output  LED2,\n    input KEY1,\n    input KEY2\n);\n\nreg LED1_r=0;\nreg LED2_r=0;\n\nalways@(posedge clk)begin\n    if(KEY1==0)LED1_r&lt;=1'b1;\n    else LED1_r&lt;=1'B0;\n   \n    if(KEY2==0)LED2_r&lt;=1'b1;\n    else LED2_r&lt;=1'B0;\nend\n\nassign LED1=LED1_r;\nassign LED2=LED2_r;\n\nendmodule<\/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 K16 [get_ports LED]\r\nset_property PACKAGE_PIN G18 [get_ports KEY]\r\nset_property PACKAGE_PIN H16 [get_ports clk]\r\nset_property IOSTANDARD LVCMOS33 [get_ports LED]\r\nset_property IOSTANDARD LVCMOS33 [get_ports KEY]\r\nset_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\u4e0b\u5de6\u8fb9\u7684\u6309\u952e\u540e\uff0c\u5de6\u8fb9\u7684\u706f\u88ab\u70b9\u4eae\uff0c\u5f53\u6309\u4e0b\u53f3\u8fb9\u7684\u6309\u952e\u540e\uff0c\u53f3\u8fb9\u7684\u706f\u88ab\u70b9\u4eae\u4e86<\/strong><\/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>\u5b8c\u6574\u5de5\u7a0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-6c62aa6c-cec1-4a76-8182-2c280e5fd9c6\" href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_XC7Z010_1.zip\">04_PL_KEY_XC7Z010_1<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_XC7Z010_1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-6c62aa6c-cec1-4a76-8182-2c280e5fd9c6\">\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-254af4b3-eee9-4e26-9658-a17ba52f4524\" href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_XC7Z020_1.zip\">04_PL_KEY_XC7Z020_1<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_XC7Z020_1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-254af4b3-eee9-4e26-9658-a17ba52f4524\">\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u6309\u952e\u63a7\u5236\u4e5f\u53ef\u4ee5\u662f\u7ec4\u5408\u903b\u8f91<strong>\uff08\u4e0d\u63a8\u8350\u4f7f\u7528\uff09<\/strong>\u00a0\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<\/p>\n\n\n\n<p>LED1=(KEY1==0)?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><\/p>\n\n\n\n<p><strong>2.2 \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><\/p>\n\n\n\n<p>\u4e0b\u9762\u6765\u4ecb\u7ecd\u6309\u952e\u6d88\u6296<\/p>\n\n\n\n<p>\u6309\u952e\u6d88\u6296\u7684\u539f\u7531\uff1a<\/p>\n\n\n\n<p>\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<\/p>\n\n\n\n<p>b.\u68c0\u6d4b\u5230\u6309\u952e\u6309\u4e0b\uff08\u5373\u7535\u5e73\u4e3a0\uff09\u8ba1\u6570\u5668\u5f00\u59cb\u8ba1\u65f6 \uff0c\u8df3\u8f6c\u5230\u72b6\u6001c<\/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\u4e3a0\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\u4e3a0\uff0c\u5219\u8ba4\u4e3a\u6309\u952e\u6709\u6548\uff0c\u8df3\u8f6c\u5230\u72b6\u6001d<\/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\u4e3a0\u65f6\uff0c \u6309\u952e\u6709\u6548\u4fe1\u53f7\u6e050<\/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\">`timescale 1ns \/ 1ps\nmodule KEY_TEST(\n    input clk,\n    output LED,\n    input KEY\n);\n\nreg [1:0]debounce_mode=2'd0;\nreg [19:0]debounce_count=20'd0;\n\nreg [1:0]KEY_r=0;\nalways@(posedge clk)begin\n    KEY_r[1]&lt;= KEY_r[0];\n    KEY_r[0]&lt;= KEY;\nend\nwire KEY_NEGEDGE=(KEY_r[1]&amp;~KEY_r[0])?1'b1:1'b0;\n\n\nreg KEY_value=0;\nalways@(posedge clk)begin\n    if(debounce_mode==0)begin\n        debounce_count&lt;=20'd0;\n        debounce_mode&lt;=2'd1;\n        KEY_value&lt;=0;\n    end\n    else if(debounce_mode==1)begin\n        if(KEY_NEGEDGE==1)begin\n            debounce_count&lt;=20'd0;\n            debounce_mode&lt;=2'd2;\n        end\n    end\n    else if(debounce_mode==2)begin\n        if(debounce_count&gt;=20'd1_000_000)debounce_mode&lt;=2'd3;\n        else begin\n            if(KEY==1)debounce_mode&lt;=2'd0;\n            debounce_count&lt;=debounce_count+1'b1;\n        end \n    end\n    else begin\n        if(KEY==1)debounce_mode&lt;=2'd0;\n        KEY_value&lt;=1'b1;\n    end\nend<\/pre>\n\n\n\n<p>\u4ee3\u7801\u7b80\u5355\u89e3\u8bfb<\/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\u4e0b\u964d\u6cbf\uff08\u4e0a\u4e2a\u65f6\u523b\u662f\u9ad8\u7535\u5e73\uff0c\u4e0b\u4e2a\u65f6\u523b\u4e3a\u4f4e\u7535\u5e73\uff0c\u4ee3\u8868\u662f\u4e0b\u964d\u6cbf\uff0c\u5373(KEY_r[1]&amp;~KEY_r[0])\uff09\uff0c\u5f53\u7cfb\u7edf\u4e3a\u4e0b\u964d\u6cbf\u7684\u90a3\u4e2a\u65f6\u523bKEY_NEGEDGE\u8f93\u51fa\u9ad8\u7535\u5e73<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">reg [1:0]KEY_r=0;\nalways@(posedge clk)begin\n    KEY_r[1]&lt;= KEY_r[0];\n    KEY_r[0]&lt;= KEY;\nend\nwire KEY_NEGEDGE=(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\u4e0b\u964d\u6cbf\uff0c\u5982\u679c\u51fa\u73b0\u4e0b\u964d\u6cbf\u8fdb\u5165\u5230\u6a21\u5f0f2\uff0c2\u5f00\u59cb\u8ba1\u6570\u5e76\u68c0\u6d4b\u6309\u952e\u72b6\u6001\u662f\u5426\u53d8\u62101\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\u4e0b\u964d\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<\/p>\n\n\n\n<p>debounce_count\u662f\u4e00\u4e2a20\u4f4d\u7684\u8ba1\u6570\u5668\uff0c\u4ece\u6309\u952e\u7684\u4e0b\u964d\u6cbf\u5f00\u59cb \u8ba1\u6570\uff0c\u76f4\u523020ms\u505c\u6b62\uff0820ms \u5bf9\u5e9450mhz\u65f6\u949f\u7684\u7b2c1000000\u4e2a\u8109\u51b2\uff09<\/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 D18 [get_ports LED]\nset_property PACKAGE_PIN G15 [get_ports KEY]\nset_property PACKAGE_PIN K18 [get_ports clk]\nset_property IOSTANDARD LVCMOS33 [get_ports LED]\nset_property IOSTANDARD LVCMOS33 [get_ports KEY]\nset_property IOSTANDARD LVCMOS33 [get_ports clk]\n\nset_property CLOCK_DEDICATED_ROUTE FALSE [get_nets {clk_IBUF}]<\/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<\/p>\n\n\n\n<p>\u5982\u679c\u9700\u8981\u589e\u52a0\u6309\u952e\u91ca\u653e\u6d88\u6296\uff0c\u539f\u7406\u4e0a\u76f8\u901a\uff0c\u53ef\u81ea\u884c\u7814\u7a76<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u5e26\u6d88\u6296\u529f\u80fd\u7684\u5b8c\u6574\u5de5\u7a0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-8fced0c4-107e-44e9-aab8-af0fff81f963\" href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_DEBOUNCE_XC7Z010_1.zip\">04_PL_KEY_DEBOUNCE_XC7Z010_1<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_DEBOUNCE_XC7Z010_1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-8fced0c4-107e-44e9-aab8-af0fff81f963\">\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-56d6c0ac-d515-4a93-a3f9-555d85fb4b55\" href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_DEBOUNCE_XC7Z010_1-1.zip\">04_PL_KEY_DEBOUNCE_XC7Z010_1<\/a><a href=\"http:\/\/www.hellofpga.com\/wp-content\/uploads\/2023\/01\/04_PL_KEY_DEBOUNCE_XC7Z010_1-1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-56d6c0ac-d515-4a93-a3f9-555d85fb4b55\">\u4e0b\u8f7d<\/a><\/div>\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":[10],"tags":[],"class_list":["post-2476","post","type-post","status-publish","format-standard","hentry","category-smart-zynq-board"],"views":547,"_links":{"self":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/2476","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=2476"}],"version-history":[{"count":9,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/2476\/revisions"}],"predecessor-version":[{"id":2492,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/posts\/2476\/revisions\/2492"}],"wp:attachment":[{"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/media?parent=2476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/categories?post=2476"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hellofpga.com\/index.php\/wp-json\/wp\/v2\/tags?post=2476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}