22.3.9 发现问题 F407 adc 采样值跳动比较大
具体描述:ADC引脚接地的情况下 大概有 10个LSB 同样 F1系列 ADC 1个LSB
结果 只要精度优于 F407
后来在勘误手册上 找到一句话:
Description
An internal noise generated on VDD supplies and propagated internally may impact the ADC
accuracy.
This noise is always active whatever the power mode of the MCU (RUN or Sleep).
Workarounds
Two steps could be followed to adapt the accuracy level to the application requirements:
1. Configure the Flash ART as Prefetch OFF and (Data + Instruction) cache ON.
2. Use averaging and filtering algorithms on ADC output codes.
说明
在 VDD 电源上产生并在内部传播的内部噪声可能会影响 ADC 精度。无论 MCU 处于何种电源模式(运行或睡眠),这种噪声始终处于活动状态。
解决方法 可以按照两个步骤来调整精度级别以适应应用程序要求:
1. 将闪存 ART 配置为预取关闭和(数据+指令)缓存打开。
2. 对 ADC 输出代码使用平均和滤波算法。
在HAL 库中 对于下面2条
__HAL_FLASH_PREFETCH_BUFFER_DISABLE(); //关闭预取缓冲器
__HAL_FLASH_DATA_CACHE_ENABLE();
这样做以后 对地测量大概也在2个LSB 左右 ,比之前好很多了。
但是这样做 会降低 F4的 性能
凭借 ART 加速器所获得的性能相当于
Flash 在 CPU 频率高达 168 MHz 时以 0 个等待周期执行程序
但是这个功能 在想精确使用ADC 的时候必须关闭。
这是F4的 设计缺陷。
STM32 F4 时钟框图