{"id":40513,"date":"2025-05-29T09:38:04","date_gmt":"2025-05-29T01:38:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/40513.html"},"modified":"2025-05-29T09:38:04","modified_gmt":"2025-05-29T01:38:04","slug":"stm32-%e5%ae%9a%e6%97%b6%e5%99%a8tim%e5%a4%96%e8%ae%be-%e8%be%93%e5%85%a5%e6%8d%95%e8%8e%b7%e6%8a%80%e6%9c%af%e5%85%a8%e8%a7%a3%e6%9e%90%ef%bc%9a%e5%8e%9f%e7%90%86%e3%80%81%e7%94%b5%e8%b7%af%e4%b8%8e","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/40513.html","title":{"rendered":"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>\u8f93\u5165\u6355\u83b7(\u94c1\u5934\u5c71\u7f8a)<\/li>\n<li>\n<ul>\n<li>\u8f93\u5165\u6355\u83b7\u57fa\u672c\u539f\u7406<\/li>\n<li>\u8f93\u5165\u6355\u83b7\u5185\u90e8\u7535\u8def<\/li>\n<\/ul>\n<\/li>\n<li>\u8f93\u5165\u6355\u83b7&#xff08;\u6c5f\u534f&#xff09;<\/li>\n<li>\n<ul>\n<li>IC&#xff08;Input Capture&#xff09;\u8f93\u5165\u6355\u83b7<\/li>\n<li>\u9891\u7387\u6d4b\u91cf<\/li>\n<li>\u8f93\u5165\u6355\u83b7\u901a\u9053<\/li>\n<li>\n<ul>\n<li>1. \u5f15\u811a\u4e0e\u5f02\u6216\u95e8\u8bbe\u8ba1<\/li>\n<li>2. \u8f93\u5165\u6ee4\u6ce2\u5668\u4e0e\u8fb9\u6cbf\u68c0\u6d4b\u5668<\/li>\n<li>3. \u9884\u5206\u9891\u5668\u4e0e\u6355\u83b7\u4e8b\u4ef6<\/li>\n<\/ul>\n<\/li>\n<li>\u4e3b\u4ece\u89e6\u53d1\u6a21\u5f0f<\/li>\n<li>\u8f93\u5165\u6355\u83b7\u7ed3\u6784<\/li>\n<li>\n<ul>\n<li>\u5355\u901a\u9053\u6d4b\u9891\u6cd5&#xff08;\u6d4b\u5468\u6cd5\u5b9e\u73b0&#xff09;<\/li>\n<li>PWMI\u57fa\u672c\u7ed3\u6784<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u8f93\u5165\u6355\u83b7(\u94c1\u5934\u5c71\u7f8a)<\/h3>\n<h4>\u8f93\u5165\u6355\u83b7\u57fa\u672c\u539f\u7406<\/h4>\n<ul>\n<li>\u6355\u83b7\u5bf9\u8c61&#xff1a;\u8f93\u5165\u6355\u83b7\u53ef\u6d4b\u91cf\u5916\u90e8\u8f93\u5165\u4fe1\u53f7\u65f6\u95f4\u53c2\u6570&#xff0c;\u4fe1\u53f7\u7531\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf\u7ec4\u6210\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013758-6837ba7661cd8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<ul>\n<li>\n<p>\u5de5\u4f5c\u65b9\u5f0f&#xff1a;\u8f93\u5165\u6355\u83b7\u7535\u8def\u6355\u6349\u4fe1\u53f7\u53d8\u5316&#xff0c;\u89e6\u53d1 CCX \u4e8b\u4ef6&#xff0c;\u5c06\u8ba1\u6570\u5668 CNT \u503c\u62cd\u7167\u4fdd\u5b58\u5230 CCR \u5bc4\u5b58\u5668&#xff0c;\u636e\u6b64\u8ba1\u7b97\u4fe1\u53f7\u65f6\u95f4\u53c2\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u4f8b\u8bb2\u89e3&#xff1a;\u4ee5\u6d4b\u91cf\u8109\u51b2\u4fe1\u53f7\u8109\u5bbd\u4e3a\u4f8b&#xff0c;\u914d\u7f6e\u5b9a\u65f6\u5668&#xff0c;\u63a5\u5165\u4fe1\u53f7\u5230\u901a\u9053\u4e00\u548c\u901a\u9053\u4e8c&#xff0c;\u5206\u522b\u6355\u6349\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf&#xff0c;\u8ba1\u7b97\u8109\u5bbd\u3002<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013758-6837ba76ace34.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u8f93\u5165\u6355\u83b7\u5185\u90e8\u7535\u8def<\/h4>\n<ul>\n<li>\n<p>\u603b\u4f53\u7ed3\u6784&#xff1a;\u5b9a\u65f6\u5668\u6709\u56db\u4e2a\u901a\u9053&#xff0c;\u901a\u9053\u4e00\u548c\u901a\u9053 2\u3001\u901a\u9053 3 \u548c\u901a\u9053 4 \u5185\u90e8\u7ed3\u6784\u4e00\u6837&#xff0c;\u9009\u53d6\u90e8\u5206\u901a\u9053\u5206\u6790\u5185\u90e8\u7ed3\u6784\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013759-6837ba7704af7.png\" alt=\"\" \/><\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u6ee4\u6ce2&#xff1a;\u4f4d\u4e8e\u7535\u8def\u7279\u5b9a\u4f4d\u7f6e&#xff0c;\u7528\u4e8e\u6ee4\u9664\u8f93\u5165\u4fe1\u53f7\u4e0a\u7684\u7ec6\u5c0f\u6bdb\u523a&#xff0c;\u5f97\u5230\u76f8\u5bf9\u7eaf\u51c0\u4fe1\u53f7\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013759-6837ba77438fd.png\" alt=\"\" \/><\/p>\n<\/li>\n<li>\n<p>\u8fb9\u6cbf\u68c0\u6d4b&#xff1a;\u7531\u8fb9\u6cbf\u68c0\u6d4b\u7535\u8def\u548c\u590d\u7528\u5668\u7ec4\u6210&#xff0c;\u53ef\u68c0\u6d4b\u8f93\u5165\u4fe1\u53f7\u53d8\u5316\u8fb9\u6cbf&#xff0c;\u8f93\u51fa\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf\u4fe1\u53f7\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013759-6837ba778bf50.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<\/li>\n<li>\n<p>\u4fe1\u53f7\u9009\u62e9&#xff1a;\u662f\u4e00\u4e2a\u590d\u7528\u5668&#xff0c;\u6709 TRC&#xff08;\u4ece\u6a21\u5f0f\u63a7\u5236\u5668\u4fe1\u53f7&#xff09;\u3001\u76f4\u63a5\u548c\u95f4\u63a5\u4e09\u8def\u8f93\u5165&#xff0c;\u5e38\u7528\u76f4\u63a5\u548c\u95f4\u63a5&#xff0c;\u53ef\u5b9e\u73b0\u901a\u9053\u95f4\u4fe1\u53f7\u4ea4\u53c9\u5f15\u7528&#xff0c;\u8282\u7701\u5f15\u811a\u3002<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013800-6837ba780e480.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<ul>\n<li>\u5206\u9891\u5668&#xff1a;\u4f4d\u4e8e\u7535\u8def\u7279\u5b9a\u90e8\u5206&#xff0c;\u5206\u9891\u7cfb\u6570\u53ef\u8bbe\u4e3a\u4e00\u5206\u9891\u3001\u4e8c\u5206\u9891\u3001\u56db\u5206\u9891\u6216\u516b\u5206\u9891&#xff0c;\u8bbe\u7f6e\u4e0d\u540c\u5206\u9891\u7cfb\u6570\u5f71\u54cd\u89e6\u53d1\u4e8b\u4ef6\u548c\u62cd\u7167\u52a8\u4f5c\u9891\u7387&#xff0c;\u4e00\u822c\u9009\u4e00\u5206\u9891 \u3002\u6bd4\u5982\u4e0b\u56fe&#xff0c;\u4e00\u5206\u9891\u5c31\u662f\u51fa\u73b0\u4e00\u4e2a\u4e0a\u5347\u6cbf\u4fe1\u53f7&#xff0c;\u89e6\u53d1\u4e8b\u4ef6&#xff0c;\u8fdb\u884c\u62cd\u7167\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013800-6837ba7894b97.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h3>\u8f93\u5165\u6355\u83b7&#xff08;\u6c5f\u534f&#xff09;<\/h3>\n<h4>IC&#xff08;Input Capture&#xff09;\u8f93\u5165\u6355\u83b7<\/h4>\n<p>\u8f93\u5165\u6355\u83b7\u6a21\u5f0f\u4e0b&#xff0c;\u5f53\u901a\u9053\u8f93\u5165\u5f15\u811a\u51fa\u73b0\u6307\u5b9a\u7535\u5e73\u8df3\u53d8\u65f6&#xff0c;\u5f53\u524dCNT\u7684\u503c\u5c06\u88ab\u9501\u5b58\u5230CCR\u4e2d&#xff0c;\u53ef\u7528\u4e8e\u6d4b\u91cfPWM\u6ce2\u5f62\u7684\u9891\u7387\u3001\u5360\u7a7a\u6bd4\u3001\u8109\u51b2\u95f4\u9694\u3001\u7535\u5e73\u6301\u7eed\u65f6\u95f4\u7b49\u53c2\u6570<\/p>\n<p>\u6bcf\u4e2a\u9ad8\u7ea7\u5b9a\u65f6\u5668\u548c\u901a\u7528\u5b9a\u65f6\u5668\u90fd\u62e5\u67094\u4e2a\u8f93\u5165\u6355\u83b7\u901a\u9053\u53ef\u914d\u7f6e\u4e3aPWMI\u6a21\u5f0f&#xff0c;\u540c\u65f6\u6d4b\u91cf\u9891\u7387\u548c\u5360\u7a7a\u6bd4<\/p>\n<p>\u53ef\u914d\u5408\u4e3b\u4ece\u89e6\u53d1\u6a21\u5f0f&#xff0c;\u5b9e\u73b0\u786c\u4ef6\u5168\u81ea\u52a8\u6d4b\u91cf<\/p>\n<ul>\n<li>\u8f93\u5165\u6355\u83b7\u57fa\u672c\u6982\u5ff5\n<ul>\n<li>\u5b9a\u4e49\u4e0e\u7535\u8def\u4f4d\u7f6e&#xff1a;\u8f93\u5165\u6355\u83b7\u82f1\u6587\u7f29\u5199 IC&#xff0c;\u5168\u79f0 input capture&#xff0c;\u5728\u5b9a\u65f6\u5668\u6574\u4f53\u7ed3\u6784\u56fe\u4e2d\u4f4d\u4e8e\u5de6\u8fb9&#xff0c;\u53f3\u8fb9\u662f\u8f93\u51fa\u6bd4\u8f83\u90e8\u5206\u3002<\/li>\n<li>\u8d44\u6e90\u5171\u7528\u60c5\u51b5&#xff1a;\u56db\u4e2a\u8f93\u5165\u6355\u83b7\u548c\u8f93\u51fa\u6bd4\u8f83\u901a\u9053\u5171\u7528\u56db\u4e2a CCR \u5bc4\u5b58\u5668&#xff0c;CH1 \u5230 CH4 \u56db\u4e2a\u901a\u9053\u5f15\u811a\u4e5f\u5171\u7528&#xff0c;\u540c\u4e00\u4e2a\u5b9a\u65f6\u5668\u4e2d\u8f93\u5165\u6355\u83b7\u548c\u8f93\u51fa\u6bd4\u8f83\u53ea\u80fd\u7528\u5176\u4e00\u3002<\/li>\n<li>\u529f\u80fd\u63cf\u8ff0&#xff1a;\u8f93\u5165\u6355\u83b7\u6a21\u5f0f\u4e0b&#xff0c;\u901a\u9053\u8f93\u5165\u5f15\u811a\u51fa\u73b0\u6307\u5b9a\u7535\u5e73\u8df3\u53d8&#xff08;\u4e0a\u5347\u6cbf\u6216\u4e0b\u964d\u6cbf&#xff09;\u65f6&#xff0c;\u5f53\u524d CNT \u7684\u503c\u4f1a\u9501\u5b58\u5230 CCR \u4e2d\u3002<\/li>\n<li>\u4f5c\u7528&#xff1a;\u53ef\u6d4b\u91cf PWM \u6ce2\u5f62\u7684\u9891\u7387\u3001\u5360\u7a7a\u6bd4\u3001\u8109\u51b2\u95f4\u9694\u3001\u7535\u5e73\u6301\u7eed\u65f6\u95f4\u7b49\u53c2\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013800-6837ba78e1699.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u9891\u7387\u6d4b\u91cf<\/h4>\n<ul>\n<li>\u9891\u7387\u6d4b\u91cf\u65b9\u6cd5\n<ul>\n<li>\u6d4b\u9891\u6cd5&#xff1a;\u5728\u95f8\u95e8\u65f6\u95f4 t&#xff08;\u901a\u5e38\u4e3a1s&#xff0c;\u56e0\u4e3a\u9891\u7387\u7684\u5b9a\u4e49\u5c31\u662f1s\u5185\u5468\u671f\u7684\u4e2a\u6570\u5c31\u662f\u9891\u7387&#xff09; \u5185\u5bf9\u4e0a\u5347\u6cbf&#xff08;\u6216\u4e0b\u964d\u6cbf&#xff09;\u8ba1\u6570\u5f97\u5230 n&#xff0c;\u5f85\u6d4b\u4fe1\u53f7\u9891\u7387 FX &#061; n \/t &#xff0c;\u9002\u5408\u6d4b\u91cf\u9ad8\u9891\u4fe1\u53f7&#xff0c;\u6d4b\u91cf\u7ed3\u679c\u66f4\u65b0\u6162\u3001\u6570\u503c\u76f8\u5bf9\u7a33\u5b9a&#xff0c;\u81ea\u5e26\u5747\u503c\u6ee4\u6ce2\u3002<\/li>\n<li>\u6d4b\u5468\u6cd5&#xff1a;\u5728\u4e24\u4e2a\u4e0a\u5347\u6cbf\u5185&#xff0c;\u4ee5\u6807\u51c6\u9891\u7387 FC \u8ba1\u6570\u5f97\u5230 n&#xff0c;\u5219\u9891\u7387 FX &#061; FC \/n &#xff0c;\u9002\u5408\u6d4b\u91cf\u4f4e\u9891\u4fe1\u53f7&#xff0c;\u66f4\u65b0\u5feb\u3001\u6570\u636e\u8df3\u53d8\u5feb&#xff0c;\u7ed3\u679c\u53d7\u566a\u58f0\u5f71\u54cd\u6ce2\u52a8\u5927\u3002<\/li>\n<li>\u4e2d\u4ecb\u9891\u7387&#xff1a;\u6d4b\u9891\u6cd5\u4e0e\u6d4b\u5468\u6cd5\u8bef\u5dee\u76f8\u7b49\u7684\u9891\u7387\u70b9&#xff0c;\u516c\u5f0f\u4e3a FM &#061; \u221a(FC \/t) &#xff0c;\u5f53\u5f85\u6d4b\u4fe1\u53f7\u9891\u7387\u5c0f\u4e8e\u4e2d\u4ecb\u9891\u7387\u65f6&#xff0c;\u6d4b\u5468\u6cd5\u8bef\u5dee\u66f4\u5c0f&#xff1b;\u5927\u4e8e\u4e2d\u4ecb\u9891\u7387\u65f6&#xff0c;\u6d4b\u9891\u6cd5\u8bef\u5dee\u66f4\u5c0f\u3002&#xff08;\u6d4b\u9891\u6cd5\u548c\u6d4b\u5468\u6cd5\u90fd\u6709 \u00b11\u7684\u8bef\u5dee&#xff0c;\u56e0\u4e3a\u7ed3\u675f\u6216\u8005\u5f00\u59cb\u7684\u65f6\u5019&#xff0c;\u4e0d\u4e00\u5b9a\u5c31\u662f\u4e00\u4e2a\u5b8c\u6574\u5468\u671f\u7684\u5f00\u59cb\u6216\u8005\u7ed3\u675f&#xff09; \u516c\u5f0f\u662f\u901a\u8fc7\u6d4b\u9891\u6cd5\u516c\u5f0f\u4e2d\u7684N\u7b49\u4e8e\u6d4b\u5468\u6cd5\u516c\u5f0f\u4e2d\u7684N,\u6c42\u89e3\u9664\u9891\u7387\u70b9\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013801-6837ba7924881.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u8f93\u5165\u6355\u83b7\u901a\u9053<\/h4>\n<ul>\n<li>\n<p>\u8f93\u5165\u6355\u83b7\u7535\u8def\u7ed3\u6784<\/p>\n<h5>1. \u5f15\u811a\u4e0e\u5f02\u6216\u95e8\u8bbe\u8ba1<\/h5>\n<ul>\n<li>\u5f15\u811a\u529f\u80fd&#xff1a;CH1~CH4 \u4e3a\u8f93\u5165\u5f15\u811a&#xff0c;\u53ef\u901a\u8fc7\u6570\u636e\u9009\u62e9\u5668\u914d\u7f6e\u4e3a \u201c\u72ec\u7acb\u8f93\u5165\u201d \u6216 \u201c\u5f02\u6216\u8f93\u5165\u201d\u3002<\/li>\n<li>\u5f02\u6216\u95e8\u4f5c\u7528\n<ul>\n<li>\u7528\u4e8e\u4e09\u76f8\u65e0\u5237\u7535\u673a\u9a71\u52a8&#xff0c;\u68c0\u6d4b\u4e09\u4e2a\u970d\u5c14\u4f20\u611f\u5668\u7684\u7535\u5e73\u7ec4\u5408&#xff0c;\u63a7\u5236\u6362\u5411\u903b\u8f91\u3002<\/li>\n<li>\u4e09\u4e2a\u5f15\u811a\u4efb\u610f\u4e00\u4e2a\u7535\u5e73\u7ffb\u8f6c&#xff0c;\u5f02\u6216\u95e8\u8f93\u51fa\u7ffb\u8f6c&#xff0c;\u53ef\u7b80\u5316\u7535\u673a\u4f4d\u7f6e\u68c0\u6d4b\u7535\u8def\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>2. \u8f93\u5165\u6ee4\u6ce2\u5668\u4e0e\u8fb9\u6cbf\u68c0\u6d4b\u5668<\/h5>\n<ul>\n<li>\u6ee4\u6ce2\u5668\n<ul>\n<li>\u529f\u80fd&#xff1a;\u6ee4\u9664\u9ad8\u9891\u6bdb\u523a\u4fe1\u53f7&#xff0c;\u901a\u8fc7\u914d\u7f6e CCMR1 \u5bc4\u5b58\u5668\u7684 ICF \u4f4d\u8bbe\u7f6e\u91c7\u6837\u9891\u7387\u4e0e\u6ee4\u6ce2\u957f\u5ea6&#xff08;\u8fde\u7eed n \u4e2a\u76f8\u540c\u7535\u5e73\u624d\u89e6\u53d1\u8f93\u51fa\u8df3\u53d8&#xff09;\u3002<\/li>\n<li>\u53c2\u6570\u903b\u8f91&#xff1a;\u91c7\u6837\u9891\u7387\u8d8a\u4f4e\u3001\u6ee4\u6ce2\u957f\u5ea6 n \u8d8a\u5927&#xff0c;\u6297\u566a\u80fd\u529b\u8d8a\u5f3a\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8fb9\u6cbf\u68c0\u6d4b\u5668\n<ul>\n<li>\u652f\u6301\u4e0a\u5347\u6cbf \/ \u4e0b\u964d\u6cbf\u89e6\u53d1&#xff0c;\u901a\u8fc7 CCER \u5bc4\u5b58\u5668\u914d\u7f6e\u89e6\u53d1\u6781\u6027\u3002<\/li>\n<li>\u53cc\u8def\u8bbe\u8ba1&#xff1a;\u6bcf\u4e2a\u901a\u9053\u652f\u6301\u4e24\u8def\u72ec\u7acb\u6ee4\u6ce2\u4e0e\u6781\u6027\u9009\u62e9&#xff08;\u5982 TI1FP1 \u548c TI1FP2&#xff09;&#xff0c;\u53ef\u4ea4\u53c9\u8fde\u63a5\u81f3\u4e0d\u540c\u6355\u83b7\u5355\u5143&#xff0c;\u7075\u6d3b\u9002\u914d PWM1 \u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>3. \u9884\u5206\u9891\u5668\u4e0e\u6355\u83b7\u4e8b\u4ef6<\/h5>\n<ul>\n<li>\u9884\u5206\u9891\u5668&#xff1a;\u901a\u8fc7 CCMR1 \u5bc4\u5b58\u5668\u7684 PSC \u4f4d\u914d\u7f6e\u5206\u9891\u7cfb\u6570&#xff08;1\/2\/4\/8 \u5206\u9891&#xff09;&#xff0c;\u964d\u4f4e\u89e6\u53d1\u4fe1\u53f7\u9891\u7387&#xff0c;\u907f\u514d\u9ad8\u9891\u4fe1\u53f7\u5bfc\u81f4\u6355\u83b7\u6ea2\u51fa\u3002<\/li>\n<li>\u6355\u83b7\u4e8b\u4ef6\n<ul>\n<li>\u89e6\u53d1\u65f6 CNT \u503c\u9501\u5b58\u81f3 CCR&#xff0c;\u5e76\u5728\u72b6\u6001\u5bc4\u5b58\u5668&#xff08;SR&#xff09;\u7f6e\u4f4d\u6807\u5fd7\u4f4d&#xff08;CCxIF&#xff09;&#xff0c;\u53ef\u914d\u7f6e\u4e3a\u4ea7\u751f\u4e2d\u65ad&#xff08;\u8f6f\u4ef6\u5e72\u9884&#xff09;\u6216\u76f4\u63a5\u786c\u4ef6\u64cd\u4f5c\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013801-6837ba79679e6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013801-6837ba79a0560.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u4e3b\u4ece\u89e6\u53d1\u6a21\u5f0f<\/h4>\n<p>\u6a21\u5f0f\u7ec4\u6210\u4e0e\u529f\u80fd<\/p>\n<ul>\n<li>\u4e3b\u6a21\u5f0f&#xff1a;\u5b9a\u65f6\u5668\u4f5c\u4e3a \u201c\u4e3b\u8bbe\u5907\u201d&#xff0c;\u901a\u8fc7 TRGO \u5f15\u811a\u8f93\u51fa\u5185\u90e8\u4fe1\u53f7&#xff08;\u5982\u66f4\u65b0\u4e8b\u4ef6\u3001\u6bd4\u8f83\u4e8b\u4ef6&#xff09;&#xff0c;\u89e6\u53d1\u5176\u4ed6\u5916\u8bbe&#xff08;\u5982\u53e6\u4e00\u4e2a\u5b9a\u65f6\u5668&#xff09;\u3002<\/li>\n<li>\u4ece\u6a21\u5f0f&#xff1a;\u5b9a\u65f6\u5668\u4f5c\u4e3a \u201c\u4ece\u8bbe\u5907\u201d&#xff0c;\u63a5\u6536\u5916\u90e8\u4fe1\u53f7&#xff08;\u5982 TRGI \u5f15\u811a\u8f93\u5165&#xff09;\u6216\u5185\u90e8\u4fe1\u53f7&#xff0c;\u63a7\u5236\u81ea\u8eab\u8fd0\u884c&#xff08;\u5982\u590d\u4f4d CNT\u3001\u542f\u52a8\u8ba1\u6570&#xff09;\u3002<\/li>\n<li>\u89e6\u53d1\u6e90\u9009\u62e9&#xff1a;\u6307\u5b9a\u4ece\u6a21\u5f0f\u7684\u89e6\u53d1\u4fe1\u53f7&#xff08;\u5982\u8f93\u5165\u6355\u83b7\u89e6\u53d1\u4fe1\u53f7 TI1FP1&#xff09;\u3002<\/li>\n<\/ul>\n<p>2. \u786c\u4ef6\u81ea\u52a8\u5316\u5e94\u7528&#xff1a;CNT \u81ea\u52a8\u6e05\u96f6<\/p>\n<ul>\n<li>\u573a\u666f&#xff1a;\u6d4b\u5468\u6cd5\u4e2d&#xff0c;\u6bcf\u6b21\u6355\u83b7\u4e0a\u5347\u6cbf\u540e\u9700\u6e05\u96f6 CNT&#xff0c;\u4ee5\u6d4b\u91cf\u4e0b\u4e00\u4e2a\u5468\u671f\u3002<\/li>\n<li>\u914d\u7f6e\u6b65\u9aa4\n<li>\u89e6\u53d1\u6e90\u9009\u62e9&#xff1a;\u9009\u4e2d\u8f93\u5165\u6355\u83b7\u89e6\u53d1\u4fe1\u53f7&#xff08;\u5982 TI1FP1&#xff09;\u3002<\/li>\n<li>\u4ece\u6a21\u5f0f\u64cd\u4f5c&#xff1a;\u914d\u7f6e\u4e3a \u201c\u590d\u4f4d\u6a21\u5f0f\u201d&#xff0c;\u89e6\u53d1\u65f6\u81ea\u52a8\u6e05\u96f6 CNT\u3002<\/li>\n<\/li>\n<li>\u4f18\u52bf&#xff1a;\u65e0\u9700\u8f6f\u4ef6\u4e2d\u65ad\u5e72\u9884&#xff0c;\u5b8c\u5168\u7531\u786c\u4ef6\u5b8c\u6210\u6355\u83b7\u4e0e\u6e05\u96f6&#xff0c;\u51cf\u8f7b CPU \u8d1f\u62c5\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013801-6837ba79dc442.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<\/ul>\n<h4>\u8f93\u5165\u6355\u83b7\u7ed3\u6784<\/h4>\n<h5>\u5355\u901a\u9053\u6d4b\u9891\u6cd5&#xff08;\u6d4b\u5468\u6cd5\u5b9e\u73b0&#xff09;<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013802-6837ba7a2265c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013802-6837ba7a5df30.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><span class=\"token comment\">\/\/ IC \u6a21\u5757\u4e3b\u8981\u4ee3\u7801<\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&#034;stm32f10x.h&#034;<\/span>                  <span class=\"token comment\">\/\/ Device header<\/span><\/span><\/p>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">Ic_Init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token comment\">\/\/\u914d\u7f6eGPIo\u53e3 \u67e5\u770b\u5f15\u811a \u5bf9\u5e94GPIo PA6<\/span><br \/>\n<span class=\"token comment\">\/\/\u914d\u7f6eGPIO\u53e3 \u5b9a\u65f6\u56683\u7684\u901a\u9053\u4e00 \u7684gpio\u5f15\u811a\u6620\u5c04\u662fgpioA6<\/span><br \/>\n<span class=\"token function\">RCC_APB2PeriphClockCmd<\/span><span class=\"token punctuation\">(<\/span>RCC_APB2Periph_GPIOA<span class=\"token punctuation\">,<\/span> ENABLE<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>GPIO_InitTypeDef GPIO_InitStruct<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">\/\/\u67e5\u770bIo\u914d\u7f6e \u9700\u8981\u5c06io\u53e3\u914d\u7f6e\u4e3a <\/span><br \/>\nGPIO_InitStruct<span class=\"token punctuation\">.<\/span>GPIO_Mode <span class=\"token operator\">&#061;<\/span> GPIO_Mode_IPU<span class=\"token punctuation\">;<\/span><br \/>\nGPIO_InitStruct<span class=\"token punctuation\">.<\/span>GPIO_Pin <span class=\"token operator\">&#061;<\/span> GPIO_Pin_6<span class=\"token punctuation\">;<\/span><br \/>\nGPIO_InitStruct<span class=\"token punctuation\">.<\/span>GPIO_Speed <span class=\"token operator\">&#061;<\/span> GPIO_Speed_50MHz<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">GPIO_Init<\/span><span class=\"token punctuation\">(<\/span>GPIOA<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>GPIO_InitStruct<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u914d\u7f6e\u65f6\u57fa\u5355\u5143 \u4f7f\u7528\u5b9a\u65f6\u56683\u7684\u901a\u9053\u4e00\u8fdb\u884c\u914d\u7f6e\u8f93\u5165\u6355\u83b7 \u5b9a\u65f6\u56682\u7528\u4e8e\u4ea7\u751fPWM\u4fe1\u53f7\u4e86<\/span><br \/>\n<span class=\"token comment\">\/\/\u5b9a\u65f6\u56683\u5728\u603b\u7ebf1\u4e0a<\/span><br \/>\n<span class=\"token function\">RCC_APB1PeriphClockCmd<\/span><span class=\"token punctuation\">(<\/span>RCC_APB1Periph_TIM3<span class=\"token punctuation\">,<\/span> ENABLE<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u914d\u7f6e\u65f6\u949f\u9009\u62e9\u6a21\u5f0f\u4e3a \u5185\u90e8\u65f6\u949f\u6a21\u5f0f<\/span><br \/>\n<span class=\"token function\">TIM_InternalClockConfig<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u914d\u7f6e\u65f6\u57fa\u5355\u5143\u7ed3\u6784\u4f53<\/span><br \/>\nTIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u6ee4\u6ce2\u7684\u539f\u7406\u662f\u56fa\u5b9af\u7684\u9891\u7387\u4e0b\u8fdb\u884c\u731c\u6837&#xff0c;\u5982\u679c\u8fde\u7eedN\u4e2a\u91c7\u6837\u70b9\u90fd\u76f8\u540c\u5c31\u8bf4\u660e\u8f93\u5165\u7a33\u5b9a&#xff0c;<\/span><br \/>\n<span class=\"token comment\">\/\/\u5982\u679c\u4e0d\u76f8\u540c\u5c31\u8bf4\u660e\u4e0d\u7a33\u5b9a\u5c31\u4f1a\u8fdb\u884c\u5904\u7406&#xff0c;f\u7684\u6765\u6e90\u6709\u4e24\u4e2a \u5185\u90e8\u65f6\u949f\u76f4\u63a5\u800c\u6765&#xff0c;\u4e00\u4e2a\u5c31\u662f\u7ecf\u8fc7\u5206\u9891\u5668\u5206\u9891\u6765<\/span><br \/>\n<span class=\"token comment\">\/\/\u6240\u4ee5\u548c\u65f6\u57fa\u5355\u5143\u5173\u7cfb\u4e0d\u5927<\/span><br \/>\nTIM_TimeBaseInitStruct<span class=\"token punctuation\">.<\/span>TIM_ClockDivision <span class=\"token operator\">&#061;<\/span> TIM_CKD_DIV1<span class=\"token punctuation\">;<\/span><br \/>\nTIM_TimeBaseInitStruct<span class=\"token punctuation\">.<\/span>TIM_CounterMode <span class=\"token operator\">&#061;<\/span> TIM_CounterMode_Up<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token comment\">\/\/\u8fd9\u91cc\u8981\u914d\u7f6e 1KHZ \u5360\u7a7a\u6bd4\u4e3a50% \u9891\u7387\u4e3a1%\u7684PWM\u6ce2\u5f62<\/span><br \/>\nTIM_TimeBaseInitStruct<span class=\"token punctuation\">.<\/span>TIM_Period <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">65535<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><span class=\"token comment\">\/\/ ARR<\/span><br \/>\nTIM_TimeBaseInitStruct<span class=\"token punctuation\">.<\/span>TIM_Prescaler <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">720<\/span><span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ PSC<\/span><br \/>\nTIM_TimeBaseInitStruct<span class=\"token punctuation\">.<\/span>TIM_RepetitionCounter <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">TIM_TimeBaseInit<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>TIM_TimeBaseInitStruct<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u914d\u7f6e \u8f93\u5165\u6355\u83b7\u5355\u5143<\/span><br \/>\nTIM_ICInitTypeDef TIM_ICInitStruct<span class=\"token punctuation\">;<\/span><br \/>\nTIM_ICInitStruct<span class=\"token punctuation\">.<\/span>TIM_Channel <span class=\"token operator\">&#061;<\/span> TIM_Channel_1<span class=\"token punctuation\">;<\/span><br \/>\nTIM_ICInitStruct<span class=\"token punctuation\">.<\/span>TIM_ICFilter <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0xF<\/span><span class=\"token punctuation\">;<\/span><br \/>\nTIM_ICInitStruct<span class=\"token punctuation\">.<\/span>TIM_ICPolarity <span class=\"token operator\">&#061;<\/span> TIM_ICPolarity_Rising<span class=\"token punctuation\">;<\/span><br \/>\nTIM_ICInitStruct<span class=\"token punctuation\">.<\/span>TIM_ICPrescaler <span class=\"token operator\">&#061;<\/span> TIM_ICPSC_DIV1<span class=\"token punctuation\">;<\/span><br \/>\nTIM_ICInitStruct<span class=\"token punctuation\">.<\/span>TIM_ICSelection <span class=\"token operator\">&#061;<\/span> TIM_ICSelection_DirectTI<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">TIM_ICInit<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>TIM_ICInitStruct<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u914d\u7f6e\u89e6\u53d1\u6e90\u9009\u62e9<\/span><br \/>\n<span class=\"token function\">TIM_SelectMasterSlaveMode<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">,<\/span> TIM_MasterSlaveMode_Enable<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">TIM_SelectInputTrigger<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">,<\/span> TIM_TS_TI1FP1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">TIM_SelectSlaveMode<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">,<\/span> TIM_SlaveMode_Reset<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/\u5f00\u59cb\u65f6\u949f\u4f7f\u80fd<\/span><br \/>\n<span class=\"token function\">TIM_Cmd<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">,<\/span> ENABLE<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token class-name\">uint32_t<\/span> <span class=\"token function\">IC_GetFreq<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">return<\/span> <span class=\"token number\">100000<\/span> <span class=\"token operator\">\/<\/span> <span class=\"token function\">TIM_GetCapture1<\/span><span class=\"token punctuation\">(<\/span>TIM3<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>PWMI\u57fa\u672c\u7ed3\u6784<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013802-6837ba7a9e99c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013802-6837ba7ad3ad2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb922\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u8f93\u5165\u6355\u83b7\u6a21\u5f0f\u4e0b\uff0c\u5f53\u901a\u9053\u8f93\u5165\u5f15\u811a\u51fa\u73b0\u6307\u5b9a\u7535\u5e73\u8df3\u53d8\u65f6\uff0c\u5f53\u524dCNT\u7684\u503c\u5c06\u88ab\u9501\u5b58\u5230CCR\u4e2d\uff0c\u53ef\u7528\u4e8e\u6d4b\u91cfPWM\u6ce2\u5f62\u7684\u9891\u7387\u3001\u5360\u7a7a\u6bd4\u3001\u8109\u51b2\u95f4\u9694\u3001\u7535\u5e73\u6301\u7eed\u65f6\u95f4\u7b49\u53c2\u6570\u3002\uff1a\u662f\u4e00\u4e2a\u590d\u7528\u5668\uff0c\u6709 TRC\uff08\u4ece\u6a21\u5f0f\u63a7\u5236\u5668\u4fe1\u53f7\uff09\u3001\u76f4\u63a5\u548c\u95f4\u63a5\u4e09\u8def\u8f93\u5165\uff0c\u5e38\u7528\u76f4\u63a5\u548c\u95f4\u63a5\uff0c\u53ef\u5b9e\u73b0\u901a\u9053\u95f4\u4fe1\u53f7\u4ea4\u53c9\u5f15\u7528\uff0c\u8282\u7701\u5f15\u811a\u3002\uff1a\u5b9a\u65f6\u5668\u6709\u56db\u4e2a\u901a\u9053\uff0c\u901a\u9053\u4e00\u548c\u901a\u9053 2\u3001\u901a\u9053 3 \u548c\u901a\u9053 4 \u5185\u90e8\u7ed3\u6784\u4e00\u6837\uff0c\u9009\u53d6\u90e8\u5206\u901a\u9053\u5206\u6790\u5185\u90e8\u7ed3\u6784\u3002\uff1a\u4ee5\u6d4b\u91cf\u8109\u51b2\u4fe1\u53f7\u8109\u5bbd\u4e3a\u4f8b\uff0c\u914d\u7f6e\u5b9a\u65f6\u5668\uff0c\u63a5\u5165\u4fe1\u53f7\u5230\u901a\u9053\u4e00\u548c\u901a\u9053\u4e8c\uff0c\u5206\u522b\u6355\u6349\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf\uff0c\u8ba1\u7b97\u8109\u5bbd\u3002\u53ef\u914d\u5408\u4e3b\u4ece\u89e6\u53d1\u6a21\u5f0f\uff0c\u5b9e\u73b0\u786c\u4ef6\u5168\u81ea\u52a8\u6d4b\u91cf\u3002<\/p>\n","protected":false},"author":2,"featured_media":40497,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[217,270,269],"topic":[],"class_list":["post-40513","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-stm32","tag-270","tag-269"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/40513.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb922\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u8f93\u5165\u6355\u83b7\u6a21\u5f0f\u4e0b\uff0c\u5f53\u901a\u9053\u8f93\u5165\u5f15\u811a\u51fa\u73b0\u6307\u5b9a\u7535\u5e73\u8df3\u53d8\u65f6\uff0c\u5f53\u524dCNT\u7684\u503c\u5c06\u88ab\u9501\u5b58\u5230CCR\u4e2d\uff0c\u53ef\u7528\u4e8e\u6d4b\u91cfPWM\u6ce2\u5f62\u7684\u9891\u7387\u3001\u5360\u7a7a\u6bd4\u3001\u8109\u51b2\u95f4\u9694\u3001\u7535\u5e73\u6301\u7eed\u65f6\u95f4\u7b49\u53c2\u6570\u3002\uff1a\u662f\u4e00\u4e2a\u590d\u7528\u5668\uff0c\u6709 TRC\uff08\u4ece\u6a21\u5f0f\u63a7\u5236\u5668\u4fe1\u53f7\uff09\u3001\u76f4\u63a5\u548c\u95f4\u63a5\u4e09\u8def\u8f93\u5165\uff0c\u5e38\u7528\u76f4\u63a5\u548c\u95f4\u63a5\uff0c\u53ef\u5b9e\u73b0\u901a\u9053\u95f4\u4fe1\u53f7\u4ea4\u53c9\u5f15\u7528\uff0c\u8282\u7701\u5f15\u811a\u3002\uff1a\u5b9a\u65f6\u5668\u6709\u56db\u4e2a\u901a\u9053\uff0c\u901a\u9053\u4e00\u548c\u901a\u9053 2\u3001\u901a\u9053 3 \u548c\u901a\u9053 4 \u5185\u90e8\u7ed3\u6784\u4e00\u6837\uff0c\u9009\u53d6\u90e8\u5206\u901a\u9053\u5206\u6790\u5185\u90e8\u7ed3\u6784\u3002\uff1a\u4ee5\u6d4b\u91cf\u8109\u51b2\u4fe1\u53f7\u8109\u5bbd\u4e3a\u4f8b\uff0c\u914d\u7f6e\u5b9a\u65f6\u5668\uff0c\u63a5\u5165\u4fe1\u53f7\u5230\u901a\u9053\u4e00\u548c\u901a\u9053\u4e8c\uff0c\u5206\u522b\u6355\u6349\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf\uff0c\u8ba1\u7b97\u8109\u5bbd\u3002\u53ef\u914d\u5408\u4e3b\u4ece\u89e6\u53d1\u6a21\u5f0f\uff0c\u5b9e\u73b0\u786c\u4ef6\u5168\u81ea\u52a8\u6d4b\u91cf\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/40513.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-29T01:38:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013758-6837ba7661cd8.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40513.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/40513.html\",\"name\":\"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-29T01:38:04+00:00\",\"dateModified\":\"2025-05-29T01:38:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/40513.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/40513.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40513.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/40513.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb922\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf12\u6b21\u3002\u8f93\u5165\u6355\u83b7\u6a21\u5f0f\u4e0b\uff0c\u5f53\u901a\u9053\u8f93\u5165\u5f15\u811a\u51fa\u73b0\u6307\u5b9a\u7535\u5e73\u8df3\u53d8\u65f6\uff0c\u5f53\u524dCNT\u7684\u503c\u5c06\u88ab\u9501\u5b58\u5230CCR\u4e2d\uff0c\u53ef\u7528\u4e8e\u6d4b\u91cfPWM\u6ce2\u5f62\u7684\u9891\u7387\u3001\u5360\u7a7a\u6bd4\u3001\u8109\u51b2\u95f4\u9694\u3001\u7535\u5e73\u6301\u7eed\u65f6\u95f4\u7b49\u53c2\u6570\u3002\uff1a\u662f\u4e00\u4e2a\u590d\u7528\u5668\uff0c\u6709 TRC\uff08\u4ece\u6a21\u5f0f\u63a7\u5236\u5668\u4fe1\u53f7\uff09\u3001\u76f4\u63a5\u548c\u95f4\u63a5\u4e09\u8def\u8f93\u5165\uff0c\u5e38\u7528\u76f4\u63a5\u548c\u95f4\u63a5\uff0c\u53ef\u5b9e\u73b0\u901a\u9053\u95f4\u4fe1\u53f7\u4ea4\u53c9\u5f15\u7528\uff0c\u8282\u7701\u5f15\u811a\u3002\uff1a\u5b9a\u65f6\u5668\u6709\u56db\u4e2a\u901a\u9053\uff0c\u901a\u9053\u4e00\u548c\u901a\u9053 2\u3001\u901a\u9053 3 \u548c\u901a\u9053 4 \u5185\u90e8\u7ed3\u6784\u4e00\u6837\uff0c\u9009\u53d6\u90e8\u5206\u901a\u9053\u5206\u6790\u5185\u90e8\u7ed3\u6784\u3002\uff1a\u4ee5\u6d4b\u91cf\u8109\u51b2\u4fe1\u53f7\u8109\u5bbd\u4e3a\u4f8b\uff0c\u914d\u7f6e\u5b9a\u65f6\u5668\uff0c\u63a5\u5165\u4fe1\u53f7\u5230\u901a\u9053\u4e00\u548c\u901a\u9053\u4e8c\uff0c\u5206\u522b\u6355\u6349\u4e0a\u5347\u6cbf\u548c\u4e0b\u964d\u6cbf\uff0c\u8ba1\u7b97\u8109\u5bbd\u3002\u53ef\u914d\u5408\u4e3b\u4ece\u89e6\u53d1\u6a21\u5f0f\uff0c\u5b9e\u73b0\u786c\u4ef6\u5168\u81ea\u52a8\u6d4b\u91cf\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/40513.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-29T01:38:04+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250529013758-6837ba7661cd8.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/40513.html","url":"https:\/\/www.wsisp.com\/helps\/40513.html","name":"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-29T01:38:04+00:00","dateModified":"2025-05-29T01:38:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/40513.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/40513.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/40513.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32 \u5b9a\u65f6\u5668TIM\u5916\u8bbe \u8f93\u5165\u6355\u83b7\u6280\u672f\u5168\u89e3\u6790\uff1a\u539f\u7406\u3001\u7535\u8def\u4e0e\u5e94\u7528\u5b9e\u6218\uff08\u94c1\u5934\u5c71\u7f8a \u6c5f\u534f \u53cc\u89e3\u6790\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=40513"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40513\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/40497"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=40513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=40513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=40513"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=40513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}