[英]STM32 (using Mbed online) showing delay at higher analog input frequency
I am new to the use of controllers. 我是控制器的新手。 I am setting up a STM32F769 Controller(Using Mbed online compiler), my target is to get a PWM output which changes its frequency according to an analog input. 我正在设置一个STM32F769控制器(使用Mbed在线编译器),我的目标是获得一个PWM输出,它根据模拟输入改变其频率。 I did some basic coding but there is a problem. 我做了一些基本的编码,但是有一个问题。 When i check the output on oscilloscope with analog input 1Hz frequency, its working perfectly, but when i check it with 100Hz analog input there is delay in the output, and i get wrong values. 当我用模拟输入1Hz频率检查示波器上的输出时,它工作正常,但是当我用100Hz模拟输入检查它时输出有延迟,我得到错误的值。 I do not understand why, because this board is faster(216 MHZ) and i should not face such issue. 我不明白为什么,因为这个板更快(216 MHZ),我不应该面对这样的问题。 (If someone could also explain, is it possible to use the board at 216MHz or other max frequency? and how?) (如果有人也可以解释,是否可以在216MHz或其他最大频率下使用电路板?以及如何?)
1st time user 第一次用户
{
meas_r=0;
for(int i=1;i<=1024;i++)
{
meas_r = meas_r+analog_value.read();
}
meas_r=meas_r/1024;
meas_v = meas_r * 3300;
out_freq=50000+(meas_v*50);
pulse.period( 1.0 / out_freq);
}
}
It should be working on 100Hz analog input as it works on 1 Hz. 它应该在100Hz模拟输入上工作,因为它工作在1 Hz。
216MHz might be the maximum clock frequency at which your processor can operate, however it does not mean that it can input/output that much frequency from its ports. 216MHz可能是处理器可以运行的最大时钟频率,但这并不意味着它可以从其端口输入/输出那么多频率。
If timing and accuracy is really important in solving the problem you have, and if you can't solve the problem with DSP, MPU, MCU, CPU, GPU, etc. I would suggest you to use an FPGA to solve the problem. 如果时间和精度对于解决您遇到的问题非常重要,如果您无法解决DSP,MPU,MCU,CPU,GPU等问题,我建议您使用FPGA来解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.