<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Encoder_tmr2 on CLing</title>
        <link>https://clingyang.github.io/tags/encoder_tmr2/</link>
        <description>Recent content in Encoder_tmr2 on CLing</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <copyright>CLing</copyright>
        <lastBuildDate>Tue, 08 Sep 2026 16:03:27 +0800</lastBuildDate><atom:link href="https://clingyang.github.io/tags/encoder_tmr2/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>AT32 TMR — 编码器接口 (TMR2)</title>
        <link>https://clingyang.github.io/p/at32-tmr-%E7%BC%96%E7%A0%81%E5%99%A8%E6%8E%A5%E5%8F%A3-tmr2/</link>
        <pubDate>Tue, 08 Sep 2026 14:52:21 +0800</pubDate>
        
        <guid>https://clingyang.github.io/p/at32-tmr-%E7%BC%96%E7%A0%81%E5%99%A8%E6%8E%A5%E5%8F%A3-tmr2/</guid>
        <description>&lt;h1 id=&#34;tmr--编码器接口-tmr2&#34;&gt;TMR — 编码器接口 (TMR2)
&lt;/h1&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;固件库&lt;/strong&gt;: AT32F403A_407_Firmware_Library V2.2.2&lt;br&gt;
&lt;strong&gt;芯片&lt;/strong&gt;: AT32&lt;br&gt;
&lt;strong&gt;源文件&lt;/strong&gt;: &lt;code&gt;AT32/AT32F403A_407_Firmware_Library_V2.2.2/project/at_start_f403a/examples/tmr/encoder_tmr2/src/main.c&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id=&#34;功能简介&#34;&gt;功能简介
&lt;/h2&gt;&lt;p&gt;本示例演示定时器编码器接口模式。定时器硬件自动解码正交编码器信号，无需 CPU 介入，适合电机转速和位置检测。&lt;/p&gt;
&lt;h2 id=&#34;完整代码&#34;&gt;完整代码
&lt;/h2&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-c&#34; data-lang=&#34;c&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;#34;at32f403a_407_board.h&amp;#34;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;#34;at32f403a_407_clock.h&amp;#34;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;代码讲解&#34;&gt;代码讲解
&lt;/h2&gt;&lt;p&gt;代码结构清晰，主要包含外设初始化配置和主循环中的功能逻辑。请结合注释理解每一步的含义。&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
