{"id":65337,"date":"2023-11-17T16:24:13","date_gmt":"2023-11-17T08:24:13","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=65337"},"modified":"2023-11-17T16:24:16","modified_gmt":"2023-11-17T08:24:16","slug":"szdpjzdys","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/65337.html","title":{"rendered":"SFR\u5728\u5355\u7247\u673a\u4e2d\u7684\u610f\u601d\uff1f"},"content":{"rendered":"\n
\u3000\u3000\u5355\u7247\u673a\u662f\u4e00\u79cd\u96c6\u6210\u7535\u8def\uff0c\u5b83\u5305\u542b\u4e86\u4e2d\u592e\u5904\u7406\u5668\u3001\u5b58\u50a8\u5668\u548c\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u7b49\u3002\u5728\u5355\u7247\u673a\u4e2d\uff0cSFR(Special Function Register)\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u5bc4\u5b58\u5668\uff0c\u7528\u4e8e\u63a7\u5236\u548c\u914d\u7f6e\u5355\u7247\u673a\u7684\u5404\u79cd\u529f\u80fd\u3002<\/strong>\u672c\u6587\u5c06\u4ecb\u7ecdSFR\u5728\u5355\u7247\u673a\u4e2d\u7684\u610f\u4e49\u548c\u5e94\u7528\uff0c\u5e76\u63a2\u8ba8\u5176\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u4e2d\u7684\u91cd\u8981\u6027\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u662f\u5355\u7247\u673a\u4e2d\u7684\u4e00\u79cd\u7279\u6b8a\u5bc4\u5b58\u5668\uff0c\u5b83\u7528\u4e8e\u5b58\u50a8\u548c\u63a7\u5236\u7279\u5b9a\u7684\u529f\u80fd\u3002SFR\u53ef\u4ee5\u901a\u8fc7\u7279\u5b9a\u7684\u5bfb\u5740\u65b9\u5f0f\u8fdb\u884c\u8bbf\u95ee\uff0c\u4ee5\u5b9e\u73b0\u5bf9\u5355\u7247\u673a\u5185\u90e8\u529f\u80fd\u7684\u914d\u7f6e\u548c\u63a7\u5236\u3002SFR\u901a\u5e38\u5305\u542b\u4e86\u63a7\u5236\u5bc4\u5b58\u5668\u3001\u72b6\u6001\u5bc4\u5b58\u5668\u548c\u6570\u636e\u5bc4\u5b58\u5668\u7b49\u3002<\/p>\n\n\n\n \u3000\u3000\u5728\u5355\u7247\u673a\u4e2d\uff0cSFR\u8d77\u5230\u4e86\u5173\u952e\u7684\u4f5c\u7528\u3002\u5b83\u53ef\u4ee5\u63a7\u5236\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u7684\u72b6\u6001\u3001\u914d\u7f6e\u4e2d\u65ad\u548c\u5b9a\u65f6\u5668\u3001\u7ba1\u7406\u7535\u6e90\u548c\u65f6\u949f\u7b49\u3002\u901a\u8fc7\u7f16\u7a0b\u5bf9SFR\u8fdb\u884c\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u5355\u7247\u673a\u7684\u529f\u80fd\u8fdb\u884c\u7075\u6d3b\u7684\u914d\u7f6e\u548c\u63a7\u5236\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u5728\u5355\u7247\u673a\u4e2d\u7684\u5e94\u7528\u975e\u5e38\u5e7f\u6cdb\uff0c\u6d89\u53ca\u5230\u5404\u4e2a\u9886\u57df\u7684\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684SFR\u5e94\u7528\u9886\u57df\uff1a<\/p>\n\n\n\n \u3000\u3000SFR\u53ef\u4ee5\u7528\u6765\u914d\u7f6e\u548c\u63a7\u5236\u5355\u7247\u673a\u7684\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\uff0c\u5982GPIO(\u901a\u7528\u8f93\u5165\/\u8f93\u51fa)\u5f15\u811a\u3002\u901a\u8fc7\u5bf9SFR\u8fdb\u884c\u7f16\u7a0b\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u5f15\u811a\u7684\u8f93\u5165\u548c\u8f93\u51fa\u72b6\u6001\u7684\u63a7\u5236\uff0c\u4ee5\u53ca\u4e2d\u65ad\u89e6\u53d1\u7684\u914d\u7f6e\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u4e2d\u7684\u5b9a\u65f6\u5668\u548c\u8ba1\u6570\u5668\u5bc4\u5b58\u5668\u53ef\u4ee5\u7528\u6765\u914d\u7f6e\u548c\u63a7\u5236\u5355\u7247\u673a\u7684\u5b9a\u65f6\u548c\u8ba1\u6570\u529f\u80fd\u3002\u901a\u8fc7\u5bf9SFR\u8fdb\u884c\u7f16\u7a0b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5b9a\u65f6\u5668\u7684\u8ba1\u6570\u95f4\u9694\u3001\u89e6\u53d1\u6761\u4ef6\u548c\u5de5\u4f5c\u6a21\u5f0f\u7b49\uff0c\u4ece\u800c\u5b9e\u73b0\u7cbe\u786e\u7684\u5b9a\u65f6\u548c\u8ba1\u6570\u529f\u80fd\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u4e2d\u7684\u4e2d\u65ad\u63a7\u5236\u5bc4\u5b58\u5668\u7528\u4e8e\u914d\u7f6e\u548c\u7ba1\u7406\u5355\u7247\u673a\u7684\u4e2d\u65ad\u529f\u80fd\u3002\u901a\u8fc7\u5bf9SFR\u8fdb\u884c\u7f16\u7a0b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e2d\u65ad\u7684\u89e6\u53d1\u6761\u4ef6\u3001\u4f18\u5148\u7ea7\u548c\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u7b49\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9\u5916\u90e8\u4e8b\u4ef6\u7684\u5feb\u901f\u54cd\u5e94\u548c\u5904\u7406\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u4e2d\u7684\u7535\u6e90\u548c\u65f6\u949f\u63a7\u5236\u5bc4\u5b58\u5668\u7528\u4e8e\u914d\u7f6e\u548c\u7ba1\u7406\u5355\u7247\u673a\u7684\u7535\u6e90\u548c\u65f6\u949f\u7cfb\u7edf\u3002\u901a\u8fc7\u5bf9SFR\u8fdb\u884c\u7f16\u7a0b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u7535\u6e90\u7684\u5de5\u4f5c\u6a21\u5f0f\u3001\u65f6\u949f\u7684\u9891\u7387\u548c\u5206\u9891\u7cfb\u6570\u7b49\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9\u7535\u6e90\u548c\u65f6\u949f\u7cfb\u7edf\u7684\u7075\u6d3b\u63a7\u5236\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u4e2d\u7684\u5b58\u50a8\u5668\u63a7\u5236\u5bc4\u5b58\u5668\u7528\u4e8e\u914d\u7f6e\u548c\u7ba1\u7406\u5355\u7247\u673a\u7684\u5b58\u50a8\u5668\u7cfb\u7edf\u3002\u901a\u8fc7\u5bf9SFR\u8fdb\u884c\u7f16\u7a0b\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5b58\u50a8\u5668\u7684\u8bbf\u95ee\u6a21\u5f0f\u3001\u5b58\u50a8\u5668\u4fdd\u62a4\u548c\u5b58\u50a8\u5668\u6620\u5c04\u7b49\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9\u5b58\u50a8\u5668\u7cfb\u7edf\u7684\u6709\u6548\u7ba1\u7406\u548c\u4fdd\u62a4\u3002<\/p>\n\n\n\n \u3000\u3000\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684SFR\u7f16\u7a0b\u5b9e\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u4f7f\u7528SFR\u6765\u914d\u7f6e\u548c\u63a7\u5236\u5355\u7247\u673a\u7684GPIO\u5f15\u811a\uff1a<\/p>\n\n\n\n \u3000\u3000“`<\/p>\n\n\n\n \u3000\u3000#include<\/p>\n\n\n\n \u3000\u3000sbit LED = P1^0; \/\/ \u5b9a\u4e49P1\u53e3\u76840\u53f7\u5f15\u811a\u4e3aLED<\/p>\n\n\n\n \u3000\u3000void main() {<\/p>\n\n\n\n \u3000\u3000LED = 0; \/\/ \u5c06LED\u5f15\u811a\u8bbe\u7f6e\u4e3a\u4f4e\u7535\u5e73<\/p>\n\n\n\n \u3000\u3000while(1) {<\/p>\n\n\n\n \u3000\u3000LED = ~LED; \/\/ \u7ffb\u8f6cLED\u5f15\u811a\u7684\u7535\u5e73<\/p>\n\n\n\n \u3000\u3000delay(); \/\/ \u5ef6\u65f6\u4e00\u6bb5\u65f6\u95f4<\/p>\n\n\n\n \u3000\u3000}<\/p>\n\n\n\n \u3000\u3000}<\/p>\n\n\n\n \u3000\u3000void delay() {<\/p>\n\n\n\n \u3000\u3000int i, j;<\/p>\n\n\n\n \u3000\u3000for(i = 0; i < 500; i++) {<\/p>\n\n\n\n \u3000\u3000for(j = 0; j < 500; j++) {<\/p>\n\n\n\n \u3000\u3000\/\/ \u7a7a\u5faa\u73af\uff0c\u5ef6\u65f6\u4e00\u6bb5\u65f6\u95f4<\/p>\n\n\n\n \u3000\u3000}<\/p>\n\n\n\n \u3000\u3000}<\/p>\n\n\n\n \u3000\u3000}<\/p>\n<\/blockquote>\n\n\n\n \u3000\u3000“`<\/p>\n\n\n\n \u3000\u3000\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c\u901a\u8fc7\u5bf9LED\u5f15\u811a\u4f7f\u7528SFR\u8fdb\u884c\u914d\u7f6e\u548c\u63a7\u5236\uff0c\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7b80\u5355\u7684LED\u95ea\u70c1\u7684\u529f\u80fd\u3002\u901a\u8fc7\u7ffb\u8f6cLED\u5f15\u811a\u7684\u7535\u5e73\uff0c\u5e76\u7ed3\u5408\u5ef6\u65f6\u51fd\u6570\u7684\u8c03\u7528\uff0c\u53ef\u4ee5\u5b9e\u73b0LED\u7684\u95ea\u70c1\u6548\u679c\u3002<\/p>\n\n\n\n \u3000\u3000SFR\u5728\u5355\u7247\u673a\u4e2d\u626e\u6f14\u7740\u91cd\u8981\u7684\u89d2\u8272\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u7f16\u7a0b\u5b9e\u73b0\u5bf9\u5355\u7247\u673a\u529f\u80fd\u7684\u7075\u6d3b\u914d\u7f6e\u548c\u63a7\u5236\u3002SFR\u7684\u5e94\u7528\u9886\u57df\u5e7f\u6cdb\uff0c\u5305\u62ec\u8f93\u5165\/\u8f93\u51fa\u63a7\u5236\u3001\u5b9a\u65f6\u5668\u548c\u8ba1\u6570\u5668\u63a7\u5236\u3001\u4e2d\u65ad\u7ba1\u7406\u3001\u7535\u6e90\u548c\u65f6\u949f\u7ba1\u7406\u4ee5\u53ca\u5b58\u50a8\u5668\u7ba1\u7406\u7b49\u3002<\/strong>\u901a\u8fc7\u6df1\u5165\u7406\u89e3\u548c\u719f\u7ec3\u638c\u63e1SFR\u7684\u4f7f\u7528\uff0c\u53ef\u4ee5\u63d0\u9ad8\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u7684\u6548\u7387\u548c\u8d28\u91cf\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u8bfb\u8005\u7406\u89e3SFR\u5728\u5355\u7247\u673a\u4e2d\u7684\u610f\u4e49\u548c\u5e94\u7528\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5355\u7247\u673a\u662f\u4e00\u79cd\u96c6\u6210\u7535\u8def\uff0c\u5b83\u5305\u542b\u4e86\u4e2d\u592e\u5904\u7406\u5668\u3001\u5b58\u50a8\u5668\u548c\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\u7b49\u3002\u5728\u5355\u7247\u673a\u4e2d\uff0cSFR(Special Function Register)\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u5bc4\u5b58\u5668\uff0c\u7528\u4e8e\u63a7\u5236\u548c\u914d\u7f6e\u5355\u7247\u673a\u7684\u5404\u79cd\u529f\u80fd\u3002<\/p>\n","protected":false},"author":1,"featured_media":64182,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[83],"class_list":["post-65337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-dpj"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/65337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=65337"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/65337\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/64182"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=65337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=65337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=65337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\u3000\u3000\u4e00\u3001SFR\u7684\u5b9a\u4e49\u548c\u4f5c\u7528<\/h2>\n\n\n\n
\u3000\u3000\u4e8c\u3001SFR\u7684\u5e94\u7528\u9886\u57df<\/h2>\n\n\n\n
\u3000\u30001. \u8f93\u5165\/\u8f93\u51fa\u63a7\u5236<\/h3>\n\n\n\n
\u3000\u30002. \u5b9a\u65f6\u5668\u548c\u8ba1\u6570\u5668\u63a7\u5236<\/h3>\n\n\n\n
\u3000\u30003. \u4e2d\u65ad\u7ba1\u7406<\/h3>\n\n\n\n
\u3000\u30004. \u7535\u6e90\u548c\u65f6\u949f\u7ba1\u7406<\/h3>\n\n\n\n
\u3000\u30005. \u5b58\u50a8\u5668\u7ba1\u7406<\/h3>\n\n\n\n
\u3000\u3000\u4e09\u3001SFR\u7684\u7f16\u7a0b\u5b9e\u4f8b<\/h2>\n\n\n\n
\n
\u3000\u3000\u7ed3\u8bba\uff1a<\/h2>\n\n\n\n