justd0 发表于 2020-8-16 20:10

【LSM6DSOX有限状态机例程学习 二】--有限状态机编程使用方法

<div style="border-width:100%">
<div style="width:9.5972in">
<div style="width:9.5972in">
<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">上一章讲了啥是有限状态机模型和</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的特点。</span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">本章我将从FSM的编程模块到Unico FSM编程界面,分别介绍各个模块、</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">区域、变量的意义,为编写自己FSM状态机程序打个基础,下面我们开始吧。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">上一帖中介绍了</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">中一共有</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">16</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">个完全独立</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">并</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">资源相同</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态机程序块</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">那么每个程序块长什么样子呢?</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">一个状态机程序块中包含了<span style="font-weight:bold">输入选择器</span>和<span style="font-weight:bold">状态机代码块</span>两部分。</span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;"><span style="font-weight:bold">输入选择器</span>能够将传感器信号或者内部计算的数据信号中选择输入信号源,</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">所支持的信号如下:</span></span></p>

<ul style="margin-left:36px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">加速度计数据、加速度和</span></span>&nbsp; <span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">矢量的模。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">陀螺仪角速度数据、角速度和</span></span> <span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">矢量的模。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">外部传感器</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">(</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">比如磁力计</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">)</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">数据,磁力和</span></span> <span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">矢量的模。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">内部计算的角度、角度和</span></span> <span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">角度矢量和</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">正确配置的机器学习模块的输出。</span></span></li>
</ul>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">其中,上述空间物理量和 矢量的模计算方法如公式:</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">怎么</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">选择输入</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">FSM</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">信号源</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">呢?这里就涉及到了一个命令&ldquo;</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SINMUX</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&rdquo;,用这个命令</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">就可以配置不同的数据到</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的数据源端了,具体用法参考末尾的</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">指令说明</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></p>

<p lang="en-US"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;"><span style="font-weight:bold">状态机代码块</span>就是我们实现自己状态机的功能模块了,如下图所示,状态机代码块</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">由<span style="font-weight:bold">固定变量、可变变量、指令程序</span>组成:</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">固定变量区</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位于程序块的最前端,长度固定</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">6</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">字节,</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">一共</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">6</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个变量,根据配置系统</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">自动更新,无需自己更改。</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">可变变量区</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位于固定变量区之后,长度随使用而改变,最长</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">36</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">字节</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,一共</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">24</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个变量,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">随用随设置。</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">指令程序区</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位于可变变量区之后,由条件和命令组成,控制输入选择器的命令</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&ldquo;</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SINMUX</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&rdquo;就在这个区域内设置。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">状态机代码块中的上述三个区域总长度</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">最多</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">256</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">字节。</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">每次上电时,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">需要</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">重新配置</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">FSM</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">代码块</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">内容</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">每个状态机代码块都可以根据输入的信号采样集数据,产生一个中断信号,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">并且修改相应的</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM_OUTS</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">寄存器状态。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;">&nbsp;&nbsp;&nbsp; <span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">指令代码保存在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">状态机程序块的可变变量区之后,由一系列实现</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">算法逻辑的状态组成。</span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;">&nbsp;&nbsp;&nbsp;&nbsp; <span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">每个指令都有一个</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">8</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">位</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的操作码,每个操作码可以实现一个</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">命令指令</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(CMD)</span></span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">或者</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令(</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RESET/NEXT,RNC</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">)</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,它们被称为</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">程序状态</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,多个指令在</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">一起组成</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">整体逻辑,其中:</span></span></p>

<ul style="margin-left:36px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">命令指令</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(CMD)</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">用于执行</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">流控制</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">输出</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">和</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">同步</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">等特殊任务</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">有的</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">命令</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 80px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">会需要参数,参数会作为一个单独的指令来执行,后面详细讲。</span></span></span></p>

<ul style="margin-left:36px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令(</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RESET/NEXT,RNC</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">)</span></span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">,</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">由</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">两个条件</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">组合在一起(</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">4</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">位的</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">RESET</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 80px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">条件和</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">4</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">位的</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">NEXT</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">条件),用来复位或者继续执行程序流。</span></span></span></p>

<p><span style="font-size:16px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">指令代码对</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">寄存器</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">和</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态机内部参数</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">偶直接影响,有些指令</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">还可以产生额外的功能,比如更新状态信息等,下面分别介绍下命令指令和</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">条件指令的特点和使用方法。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">命令指令</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(CMD)</span></span></span></p>

<p lang="en-US"><span style="font-size:16px;"><span style="font-family:&quot;Times New Roman&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">命令指令是修改状态机行为中的<span style="font-weight:bold">流控制、输出</span>、和<span style="font-weight:bold">同步</span>的行为。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当一个命令被执行时,会</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">立即执行</span></span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">(</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">不需要更新输入采样集</span></span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">)</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">程序指针</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(PP)</span></span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">被设置为下一行,将执行如下动作:</span></span></p>

<ul style="margin-left:36px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">如果新的一行是一个</span><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">命令指令</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">,则</span><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">立即执行</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">此行命令。</span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">如果新的一行是一个</span><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">,则在</span><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">下一个输入采样值到来</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">之时,</span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">处理此行条件判断指令。</span></span></li>
</ul>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">有些命令指令可能会需要<span style="font-weight:bold">参数</span>,需要的参数必须在命令指令<span style="font-weight:bold">下一行定义</span>。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">这里用</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">&quot;</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">STHR1</span></span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">&quot;</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">命令来举例,该指令用来动态改变阈值</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">1(THRESH1)</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的值,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">U</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nico</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">中的配置方法如下:</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当程序指针</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">(PP)</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">指向状态</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">S0</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">0</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">x0A</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">地址时,设备识别出</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">&quot;0xAA&quot;</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">指令码为</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">&quot;</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">STHR1</span></span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">&quot;</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">命令。</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">该指令需要两个参数,那么设备就</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">不等待新的输入采样集</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">直接运行</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">S0-S2</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">三个状态</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">执行后阈值</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">1</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的值将被设置为&ldquo;</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">0x5640</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&rdquo;即小数&ldquo;</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">100.0</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&rdquo;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令(</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RESET/NEXT,RNC</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">)</span></span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令用于<span style="font-weight:bold">重置</span>或者<span style="font-weight:bold">继续</span>程序流,条件指令在<span style="font-weight:bold">一个新的输入采样集准备好</span>后,</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">在一个<span style="font-weight:bold">单一状态</span>下执行。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令中用于重置判断的RESET条件定义在操作码的高4位,而用于判断继续的</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">NEXT指令定义在操作码的低4位,条件指令的执行逻辑如下图所示:</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当进入条件指令后,</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">首先</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">判断重置条件</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">(RESET)</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,只有在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">RESET</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">条件</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">不满足</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">时,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">才判断继续条件</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">(NEXT)</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">当两个条件<span style="font-weight:bold">均不满足</span>时,状态机会<span style="font-weight:bold">等待一个新的采样集</span>到来,然后<span style="font-weight:bold">重新开始</span>判断。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">满足</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RESET</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">时,就会发生</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">向复位点切换</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的状态过渡,即</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">PP=PR</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RESET</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件不满足</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">且</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">NEXT</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">条件满足</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">时,就会</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">向下一个状态过渡</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,即</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">PP = PP+1</span></span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">;</span></span></p>

<p lang="en-US"><span style="font-size:16px;"><span style="font-family:&quot;Times New Roman&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">默认情况下,</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">复位点</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(RP)</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">被设置为</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">第一个状态</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,但可以通过</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">&quot;</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SRP/CRP</span></span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">&quot;</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">指令</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">动态改变</span></span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">复位点的位置</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">值得注意的是,</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RESET</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">和</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">NEXT</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">条件为</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">同一个条件</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的情况是</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">没有意义</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">条件指令能够判断的条件一共有三种:</span></span></p>

<ul style="margin-left:36px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">超时</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">:当设置了定时器,定时计数器</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">TC</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">的值达到</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">零</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">的时候,条件满足,成立。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">阈值比较</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">:当启动的输入值</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">高于</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">或低于</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">)</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">设定的阈值时,条件满足,成立。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">过零检测</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">:当启动的输入</span><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">越过零位</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">时,条件满足,成立。</span></span></li>
</ul>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">以上就是命令指令和条件指令的所有特点了。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">指令集中一共提供了</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">16</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">个</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">条件指令和</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">35</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">个</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">命令指令。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">我已经将所有</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">指令集使用说明翻译成了中文</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,并排版做成了一个</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">速查</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">PDF</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,共享给大家使用。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p lang="en-US"><span style="font-size:16px;"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">U</span><span style="font-family:&quot;Microsoft YaHei&quot;">nicoGUI</span></span></span></p>

<p lang="en-US"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">上面讲了</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">程序块的结构和变量区,那怎么去编程呢?</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">ST</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">很贴心的出了一款</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">上位机</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">-</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">U</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nicoGUI</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,可以配置</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">LSM6DSOX</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">里的所有寄存器,</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">甚至可以直接</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">显示状态机图,下面我将详细介绍下</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">U</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">nicoGUI</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">编程部分。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">关于如何连接开发板和启动</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">U</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nicoGUI</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">软件,如果有问题可以参考 </span><a href="https://bbs.eeworld.com.cn/thread-1117573-1-1.html"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">LSM6DSOX开</span></a></span></p>

<p><span style="font-size:16px;"><a href="https://bbs.eeworld.com.cn/thread-1117573-1-1.html"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">箱与体验&ldquo;Port not open &amp; not supported &rdquo;问题解决</span></a><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。这里默认大家都能</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">正常打开</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">UnicoGUI</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">软件了哈。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">U</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nico</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的主界面左侧,点开</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">模块,可以看到界面中一共有三个标签栏,</span></span></p>

<p><span style="font-size:16px;"><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Configuration</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Interrupt</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Debug</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">默认的界面就是状态机设置、编程的界面,如下图所示。</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">在这个界面中我们可以看到有很多的按键和输入框,参考</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">U</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nico</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">上</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">使用</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">.pdf</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">文件中,</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">我标注了</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">8</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个红框区域,逐一来看:</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">1</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">StateMachine Selection</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,状态机选择</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,这个下拉菜单中一共有</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">16</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个选项,对应</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的就是</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">前面讲的</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">16</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">个独立的状态机程序块</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">2</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">FSM_ODR,FSM</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">频率</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">(Output Data Rate)</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,这个值在限制了加速度</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">/</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">角速度数据</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">传输到</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">代码块的最高频率,建议是将加速度</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">/</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">角速度的输出频率高于这个值,也就</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">是在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">U</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nico</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">主界面</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Opitions</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">中</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Accelerater output data rate</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">和</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Gyrocope Output data rate</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">值高于</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">FSM ODR</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的值,</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">避免欠采样问题发生。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">3</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">L</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">ong_Counter,</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">16</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">位计数器</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,一个最大可以计数</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">65535</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">的全局计数器,也就是</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">所有状态机程序块</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">公用。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">M</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">ax Value</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">是设置计数器的最大溢出值,</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">16</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">位数据形式标志(例如</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">65525</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">填写</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">FFFF)</span></span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">底下</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">两个勾选可以设置计数器溢出时是否产生</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">INT1/INT2</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">外部中断。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">计数器的值可以从程序中使用</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&ldquo;</span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">INCR</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">&rdquo;来增加。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">4</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">Converter,</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">格式转换</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,由于</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">中用的都是半精度浮点数</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">HFP</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">所以在这给我们提供了</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">32</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位浮点数</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">转</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">16</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位浮点数、</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">16</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位转</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">32</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">位的小工具。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">5</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SM</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x status,</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态机</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态设置</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,这个区域有三个选项,</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">E</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nabled</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">用于</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">启动</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">状态机</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">x</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">只有勾选</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Enabled</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">该状态机程序块才会工作。</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">INT1 INT2</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">分别将状态机的中断</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">路由</span></span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">到</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">INT1</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">、</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">INT2</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">外部中断上,</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">16</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个状态机</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">可以</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">独立设置启动与否</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,绑定外部中断。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">6</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SM</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x Fixed Data Section,</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态机</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">固定变量区</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,显示了</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">6</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个变量和</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">2</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个开关:</span></span></p>

<ul style="margin-left:108px; unicode-bidi:embed" type="disc">
        <li style="vertical-align: middle;"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">C</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">onfigA</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">和</span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">configB</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">中储存了程序所使用的的资源量</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">Size </span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">显示的是状态机</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">总的字节数</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,图中由于没有配置任何资源,</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 160px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">所以显示的</span></span></span><span style="font-size:16px;"><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">6</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">字节为固定变量区大小。</span></span></span></p>

<ul style="margin-left:108px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">S</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">etting</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">中保存了当前程序状态,选择的掩码,选择的阈值,输入</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 160px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">信号等等。</span></span></span></p>

<ul style="margin-left:108px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">Reset Pointer(RP)</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">复位点</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,储存了条件指令中返回判断</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">(RESET)</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 160px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">为真所跳转的地址。</span></span></span></p>

<ul style="margin-left:108px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">P</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">rogram Pointer(PP)</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">当前运行程序点,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">储存了当前采样时间内</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 160px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">正在执行的指令的地址。</span></span></span></p>

<ul style="margin-left:108px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">H</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">ysteresis </span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">回滞变量</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">开关,启动该选项后,下方的</span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">H</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">ysteresis</span></span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 160px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">回滞变量可以设置。</span></span></span></p>

<ul style="margin-left:108px; unicode-bidi:embed" type="disc">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">D</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">ecimation</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">降频变量</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">开关,启动该选项后,下方的</span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">dest</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">降频变量</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 160px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">可以设置。</span></span></span></p>

<p style="margin-left:72px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">上面的固定变量,在用UnicoGUI的时候这六个变量都是<span lang="zh-CN" style="font-weight:bold">跟随编程操作自动更改的,</span></span></span></p>

<p style="margin-left:72px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">无需自行更改。</span></span></p>

<p style="margin-left:72px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当我们想要直接使用</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">LSMC6DSOX</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">在自己的项目中的时候,则需要考虑设置其中的值。</span></span></p>

<p style="margin-left:72px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">7</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SM</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x Variable Data Section,</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态机</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">可变变量区</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,其中显示了</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">24</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个变量,</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">共计</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">36</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个字节,</span></span><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">当我们用不到某些变量的时候,</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Unico</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">就不会配置该变量到</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">状态机程序块中,也就不占用内存。</span></span><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">其中<span style="font-weight:bold">黑色字体</span>的就是可以设置的变量,</span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">T</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">hresh1-3</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,阈值</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,在条件指令中,用来比较输入信号对应轴的数据是</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">否到达阈值。</span></span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">H</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">ysteresis</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,回滞参数,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">当设置了回滞参数后,在对某轴进行阈值比较时,</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">会将</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">比较值增加回滞参数变成一个比较区间,如下图所示。</span></span></span></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p style="margin-left: 40px;">&nbsp;</p>

<p style="margin-left: 80px;">&nbsp;</p>

<p style="margin-left:108px"><span style="font-size:16px;"></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">M</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">asksA-C</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,轴选择掩码</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,用于</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">指定输入数据的哪个轴</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">进行阈值条件或</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">过零条件判断。</span></span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">T</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">imer1-3</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,定时器值</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,在条件指令中,设置的定时器比较的时间值。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">D</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">est</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,降频因子,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">用来降低状态机处理传感器数据的频率,</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">将</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">该状态机</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">处理</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">数据的频率降为</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">FSM ODR/Dest</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">Decision Tree,机器学习决策树接口,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">通过&ldquo;</span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">CHKDT</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">&rdquo;命令检查</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">机器学习</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">核心内部的决策树结果,当</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">FSM</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">和机器学习结合的时候</span></span></span></p>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">就需要用到这个参数。</span></span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;"><span style="font-weight:bold">灰色字体</span>的是没法直接设置的变量,</span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">T</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">emporary MaskA-C</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,临时掩码</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,用来保存</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">MasksA-C</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">的复制值。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">DX,DY,DZ,DV</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">三轴角度、角度和矢量的模,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">显示的是当前传感器</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">角速度积分得到的角度值。</span></span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">D</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">eltaT</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,角速度积分参数,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">角速度会乘上该值后积分乘角度值</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">PAS,</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">Previous axis sign</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,上一个轴号,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">储存前一个采样的轴号,在</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">零点交叉条件下使用</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">DESC</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,内部计数器,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">在降频时使用,由设备自动管理。</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">TC</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">Timer Counter</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,内部临时定时计数器,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">用于检测定时器是否</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">过期。</span></span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">8</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">、</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">SM</span></span><span lang="en-US" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x Instructions Section,</span></span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">程序指令区,</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">上图中这个区域只有四个按键,</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">分别是</span></span><span style="font-size:16px;"><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Add State </span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">增加状态指令</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Import State Machine</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">导入状态机指令</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Export State Machine</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">导出状态机指令</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">和</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">Reset State Machine</span><span lang="zh-CN" style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">重置状态机指令</span></span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">当点击Add State按键后,就可以增加一条状态指令,如下图所示</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">图中红框内容从左至右分别是:</span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">S0&nbsp; </span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态号</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,随着状态指令增加,状态号依次递增</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">0</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">x06 </span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">状态地址,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">也是随着状态指令增加而增长,</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">Reset Pointer(RP)</span></span></span></li>
</ul>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">复位点</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">和</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">P</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">rogram Pointer(PP)</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">当前运行程序点中的数据就是指这个</span></span></span></p>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">地址,</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">首状态地址随前面固</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">定</span></span></span><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">变量和可变变量总长度而定,图中由于</span></span></span></p>

<p style="vertical-align: middle; margin-left: 120px;"><span style="font-size:16px;"><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">只有</span></span></span><span style="font-size:16px;"><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">6</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">个固定长度,因此状态</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">S0</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">地址为</span></span><span lang="en-US"><span style="font-family:&quot;Microsoft YaHei&quot;">0x06</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">。</span></span></span></p>

<ul style="margin-left:72px; unicode-bidi:embed" type="circle">
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">RNC</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">R</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">eset/Next conditions</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">,选择该条状态为条件指令</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">CMD</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,Commands,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">选择该条状态为命令指令</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">指令选择框</span></span><span style="font-family:&quot;Microsoft YaHei&quot;">,选择需要的指令</span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">16</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">进制指令码,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">所选指令的</span></span><span lang="en-US"><span style="font-family:&quot;Times New Roman&quot;">16</span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">进制形式</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">Add</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">增加状态按钮,在</span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">此状态前</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">增加状态</span></span></span></li>
        <li style="vertical-align:middle"><span style="font-size:16px;"><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Times New Roman&quot;">R</span></span></span><span lang="en-US"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">emove</span></span></span><span lang="zh-CN"><span style="font-weight:bold"><span style="font-family:&quot;Microsoft YaHei&quot;">,</span></span></span><span lang="zh-CN"><span style="font-family:&quot;Microsoft YaHei&quot;">删除状态按钮,删除此条状态。</span></span></span></li>
</ul>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">模块的</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">I</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">nterrupt</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">界面下,分成了两个区域,如图所示。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">左侧为输入加速度、角速度、输出外部中断INT1/INT2的波形图。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">右侧为16个状态机的输出寄存器OUT_Sx的数据,通过点击read,可以读取当前的值。</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">在</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">模块的</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">D</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">ebug</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">界面下,也是分成了两个区域,如下图所示。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">左侧为我们写的状态机图,通过分析它可以很清楚的看到我们的状态机状态是如何</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">改变的。</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">右侧为调试区域,通过导入采集的输入数据集,可以对左边的状态机进行仿真调试,</span></span></p>

<p style="margin-left:36px"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">这里就先不细说了。</span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">以上就是对</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">LSM6DSOX</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">中</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">FSM</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">编程模块各个模块和参数的基础认识,对这些有了初步的</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">认识和了解之后,我们就可以着手看看示例状态机程序,分析下其工作流程和编写流程了</span><span lang="en-US" style="font-family:&quot;Microsoft YaHei&quot;">~</span></span></p>

<p lang="en-US"><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;">&nbsp;</span></span></p>

<p><span style="font-size:16px;"><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">以下是</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">35</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个命令指令和</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">16</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">个条件指令的简介截图,翻译文档我放在文章末尾了</span><span lang="en-US" style="font-family:&quot;Times New Roman&quot;">~</span><span lang="zh-CN" style="font-family:&quot;Microsoft YaHei&quot;">:</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;"><span style="font-weight:bold">命令指令</span></span></span></p>

<p><span style="font-size:16px;"></span></p>

<p><span style="font-size:16px;"><span style="font-family:&quot;Microsoft YaHei&quot;"><span style="font-weight:bold">条件指令</span></span></span></p>

<p><span style="font-size:16px;"></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;">指令集详细介绍的翻译文件放在下方了,大家有什么问题直接下方留言交流呀~</span></p>

<p><span style="font-size:16px;">**** Hidden Message *****</span></p>
</div>
</div>
</div>

Fly666 发表于 2020-9-21 10:04

感谢科普

ccccffff 发表于 2020-10-4 11:05

<p>好</p>

15639928287 发表于 2020-10-14 16:18

<p>感谢分享</p>

zhangpeng2 发表于 2020-12-11 19:58

<p>扫盲</p>

cj_information 发表于 2020-12-29 13:52

<p>感谢作者的无私付出,谢谢</p>

kinggate1 发表于 2021-7-30 12:30

<p>感谢分享</p>

xugaolei 发表于 2023-6-14 11:55

<p>看看</p>

Clavin_z 发表于 2024-6-5 10:10

<p>感谢</p>
页: [1]
查看完整版本: 【LSM6DSOX有限状态机例程学习 二】--有限状态机编程使用方法