{"id":40506,"date":"2023-10-04T11:47:05","date_gmt":"2023-10-04T03:47:05","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=40506"},"modified":"2023-10-04T11:47:05","modified_gmt":"2023-10-04T03:47:05","slug":"sygzduqsw","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/40506.html","title":{"rendered":"\u4f7f\u7528GD32\u4e2d\u7684USART\u8d77\u59cb\u4f4d"},"content":{"rendered":"

  USART\uff08Universal Synchronous\/Asynchronous Receiver\/Transmitter\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u6570\u636e\u4f20\u8f93\u534f\u8bae\uff0c\u5b83\u53ef\u4ee5\u5b9e\u73b0\u7535\u8111\u548c\u5176\u4ed6\u7535\u5b50\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u3002\u5b83\u7684\u4f7f\u7528\u88ab\u5e7f\u6cdb\u5e94\u7528\u4e8e\u5404\u79cd\u7535\u5b50\u8bbe\u5907\uff0c\u5305\u62ec\u8ba1\u7b97\u673a\u3001\u624b\u673a\u3001PLC\u7b49\u3002GD32\u662f\u4e00\u6b3e\u5d4c\u5165\u5f0f\u5fae\u63a7\u5236\u5668\uff0c\u5b83\u53ef\u4ee5\u4f7f\u7528USART\u8d77\u59cb\u4f4d\u6765\u5b9e\u73b0\u6570\u636e\u7684\u4f20\u8f93\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528GD32\u4e2d\u7684USART\u8d77\u59cb\u4f4d\uff0c\u4ee5\u53ca\u5b83\u7684\u539f\u7406\u548c\u4f18\u70b9\u3002<\/p>\n

USART\u8d77\u59cb\u4f4d\u7684\u6982\u5ff5<\/h2>\n

  USART\u8d77\u59cb\u4f4d\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6570\u636e\u4f20\u8f93\u534f\u8bae\uff0c\u5b83\u53ef\u4ee5\u5b9e\u73b0\u5728\u7535\u8111\u548c\u5176\u4ed6\u7535\u5b50\u8bbe\u5907\u4e4b\u95f4\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u3002\u5b83\u7684\u539f\u7406\u662f\uff0c\u5f53\u63a5\u6536\u5230\u4e00\u4e2a\u7279\u5b9a\u7684\u8d77\u59cb\u4f4d\uff08start bit\uff09\u65f6\uff0c\u63a5\u6536\u7aef\u5c31\u4f1a\u5f00\u59cb\u63a5\u6536\u6570\u636e\uff0c\u800c\u53d1\u9001\u7aef\u5c31\u4f1a\u5f00\u59cb\u53d1\u9001\u6570\u636e\u3002\u5f53\u53d1\u9001\u7aef\u53d1\u9001\u5b8c\u6570\u636e\u540e\uff0c\u4f1a\u53d1\u9001\u4e00\u4e2a\u505c\u6b62\u4f4d\uff08stop bit\uff09\uff0c\u4ee5\u8868\u793a\u6570\u636e\u4f20\u8f93\u7ed3\u675f\u3002\u8fd9\u6837\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u53cc\u65b9\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u3002<\/p>\n

\u4f7f\u7528GD32\u4e2d\u7684USART\u8d77\u59cb\u4f4d<\/h2>\n

  \u4f7f\u7528GD32\u4e2d\u7684USART\u8d77\u59cb\u4f4d\uff0c\u9996\u5148\u9700\u8981\u5728GD32\u4e2d\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u6b63\u786e\u7684\u63a5\u6536\u548c\u53d1\u9001\u6570\u636e\u3002\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

  1.\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u5bc4\u5b58\u5668<\/h3>\n

  \u9996\u5148\uff0c\u9700\u8981\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u5bc4\u5b58\u5668\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u6b63\u786e\u7684\u63a5\u6536\u548c\u53d1\u9001\u6570\u636e\u3002\u8fd9\u91cc\uff0c\u9700\u8981\u4f7f\u7528USART_CR1\u5bc4\u5b58\u5668\uff0c\u6765\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u7684\u505c\u6b62\u4f4d\u548c\u6570\u636e\u4f4d\uff0c\u4ee5\u53ca\u5176\u4ed6\u53c2\u6570\u3002<\/p>\n

  2.\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u4e2d\u65ad<\/h3>\n

  \u5176\u6b21\uff0c\u9700\u8981\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u4e2d\u65ad\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u6b63\u786e\u7684\u63a5\u6536\u548c\u53d1\u9001\u6570\u636e\u3002\u8fd9\u91cc\uff0c\u9700\u8981\u4f7f\u7528USART_CR2\u5bc4\u5b58\u5668\uff0c\u6765\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u4e2d\u65ad\uff0c\u4ee5\u53ca\u5176\u4ed6\u53c2\u6570\u3002<\/p>\n

  3.\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u53d1\u9001<\/h3>\n

  \u6700\u540e\uff0c\u9700\u8981\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u53d1\u9001\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u6b63\u786e\u7684\u63a5\u6536\u548c\u53d1\u9001\u6570\u636e\u3002\u8fd9\u91cc\uff0c\u9700\u8981\u4f7f\u7528USART_DR\u5bc4\u5b58\u5668\uff0c\u6765\u914d\u7f6eUSART\u8d77\u59cb\u4f4d\u53d1\u9001\uff0c\u4ee5\u53ca\u5176\u4ed6\u53c2\u6570\u3002<\/p>\n

\u4f18\u70b9<\/h2>\n

  \u4f7f\u7528USART\u8d77\u59cb\u4f4d\uff0c\u53ef\u4ee5\u5b9e\u73b0\u7535\u8111\u548c\u5176\u4ed6\u7535\u5b50\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u3002\u5b83\u7684\u4f18\u70b9\u662f\uff1a<\/p>\n

  1.\u6570\u636e\u4f20\u8f93\u901f\u5ea6\u5feb<\/h3>\n

  USART\u8d77\u59cb\u4f4d\u53ef\u4ee5\u5b9e\u73b0\u6bd4\u8f83\u5feb\u7684\u6570\u636e\u4f20\u8f93\u901f\u5ea6\uff0c\u53ef\u4ee5\u5728\u5f88\u77ed\u7684\u65f6\u95f4\u5185\u5b8c\u6210\u6570\u636e\u4f20\u8f93\u3002<\/p>\n

  2.\u4f4e\u529f\u8017<\/h3>\n

  USART\u8d77\u59cb\u4f4d\u53ef\u4ee5\u6709\u6548\u7684\u964d\u4f4e\u529f\u8017\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5728\u5f88\u77ed\u7684\u65f6\u95f4\u5185\u5b8c\u6210\u6570\u636e\u4f20\u8f93\uff0c\u4ece\u800c\u51cf\u5c11\u7535\u6c60\u7684\u6d88\u8017\u3002<\/p>\n

  3.\u7075\u6d3b\u6027\u5f3a<\/h3>\n

  USART\u8d77\u59cb\u4f4d\u53ef\u4ee5\u652f\u6301\u591a\u79cd\u4e0d\u540c\u7684\u6570\u636e\u4f20\u8f93\u534f\u8bae\uff0c\u53ef\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  USART\u8d77\u59cb\u4f4d\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u6570\u636e\u4f20\u8f93\u534f\u8bae\uff0c\u5b83\u53ef\u4ee5\u5b9e\u73b0\u7535\u8111\u548c\u5176\u4ed6\u7535\u5b50\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\u3002<\/strong>\u4f7f\u7528GD32\u4e2d\u7684USART\u8d77\u59cb\u4f4d\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5feb\u901f\u3001\u4f4e\u529f\u8017\u3001\u7075\u6d3b\u7684\u6570\u636e\u4f20\u8f93\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528GD32\u4e2d\u7684USART\u8d77\u59cb\u4f4d\uff0c\u4ee5\u53ca\u5b83\u7684\u539f\u7406\u548c\u4f18\u70b9\uff0c\u5e0c\u671b\u5bf9\u8bfb\u8005\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

USART\uff08UniversalSynchronous\/AsynchronousReceiver\/Transmitter\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u6570\u636e\u4f20\u8f93\u534f\u8bae\uff0c\u5b83\u53ef\u4ee5\u5b9e\u73b0\u7535\u8111\u548c\u5176\u4ed6<\/p>\n","protected":false},"author":1,"featured_media":4132,"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":[305],"class_list":["post-40506","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-dzjs"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/40506","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=40506"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/40506\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=40506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=40506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=40506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}