单片机之STM32 adc Regular injected 意思和区别

STM32的每个ADC模块通过内部的模拟多路开关,可以切换到不同的输入通道并进行转换。STM32特别地加入了多种成组转换的模式,可以由程序设置好之后,对多个模拟通道自动地进行逐个地采样转换。

有2种划分转换组的方式:规则通道组和注入通道组。通常规则通道组中可以安排最多16个通道,而注入通道组可以安排最多4个通道。

    在执行规则通道组扫描转换时,如有例外处理则可启用注入通道组的转换。 内容来自www.dqjsw.com.cn电气自动化技术网

    一个不太恰当的比喻是:规则通道组的转换好比是程序的正常执行,而注入通道组的转换则好比是程序正常执行之外的一个中断处理程序。

    再举一个不一定使用的例子:

    假如你在家里的院子内放了5个温度探头,室内放了3个温度探头;你需要时刻监视室外温度即可,但偶尔你想看看室内的温度;因此你可以使用规则通道组 循环扫描室外的5个探头并显示AD转换结果,当你想看室内温度时,通过一个按钮启动注入转换组(3个室内探头)并暂时显示室内温度,当你放开这个按钮后, 系统又会回到规则通道组继续检测室外温度。

    从系统设计上,测量并显示室内温度的过程中断了测量并显示室外温度的过程,但程序设计上可以在初始化阶段分别设置好不同的转换组,系统运行中不必再 变更循环转换的配置,从而达到两个任务互不干扰和快速切换的结果。可以设想一下,如果没有规则组和注入组的划分,当你按下按钮后,需要从新配置AD循环扫 描的通道,然后在施放按钮后需再次配置AD循环扫描的通道。

     上面的例子因为速度较慢,不能完全体现这样区分(规则组和注入组)的好处,但在工业应用领域中有很多检测和监视探头需要较快地处理,这样对AD转换的分组将简化事件处理的程序并提高事件处理的速度。


感谢作者

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
V5.4.4完整版/2020年5月 STM32电机控制软件开发套件(MCSDK)- 完整源代码 主要变化: Version 5.4.4 is mostly a bug fix release of X-Cube-MCSDK v5.4.3. It also introduces some new feature. ◾Added Support for PFC on STM32F3. This support is added as an example for the STEVAL-CTM010V1 Dual motor demo board. ◾Atollic TrueSTUDIO & SW4STM32 Deprecation. Atollic TrueSTUDIO and SW4STM32 IDEs are no longer actively developed and ST's strategy is to replace them with STM32CubeIDE. Recent STM32 series like STM32G4 devices for instance, are already not supported by all these IDEs. In a near future release of the Motor Control SDK, support for these IDE will be dropped and it will not be possible anymore to generate a project for them from the Workbench. ◾Introduced a workaround for the issue with injected ADC conversions that exists on STM32G4xx Cut 2.2 devices. See the dedicated section below for more details. ◾Reintroduced the correct ST Motor Profiler version (the same as release 5.4.1 of the SDK). The Motor Profiler delivered with MCSDK 5.4.2 and 5.4.3 was incomplete. ◾Fixed an issue with the faulty setting of the maximum application current for the second drive in dual drive configurations ◾Fixed an issue with Position Control configurations using an absolute position encoder (with Z signal). ◾Fixed another issue with Position Control where a division by 0 was possible. ◾Fixed a bootstrap capacitor charge issue in ICS configurations ◾Fixed a SW Error that could occur during the offset measurement loop ◾Fixed a code generation issue resulting in a compilation error when enabling open loop. ◾Fixed a STM32H7 example compilation issue - missing files have been added. ◾Fixed a generation issue for some STM32G0 and STM32F0 devices where TIM2 does not exist but was referenced in the code anyway. This resulted in a compilation failure. ◾Fixed an issue with STM32F1 HD devices in single shunt configurations ◾In the workbench, the maximum PWM frequency can now be set as high as 500 KHz. ◾Fixed an issue due to the limited RShunt resolution. Now, values such as 0.00025 Ω are accepted. ◾Fixed an issue with NVIC configuration for IHM34V2 inverter boards. ◾Fixed a Workbench issue that resulted in a wrong pin assignment when creating new projects based on the NUCLEO-G431RB control board. See section Pin assignment with NUCLEO-G431RB for more details. ◾Fixed an issue that resulted in incorrect overcurrent settings with some power boards. See section Over current settings correction for some power boards ◾Enable users to select DAC channel 2 with STM32L452

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值