How to monitor an analog signal real-time in Simulink?
6 次查看(过去 30 天)
显示 更早的评论
I am using Simulink (Embedded Coder) to program my LAUNCHXL-F28379D TI C2000 microcontroller.
I have created a model to detect the frequency of a signal and I want to use this model to detect the frequency of the encoder signal (in order to estimate the angular velocity of the motor). The model seems to be successfully identifying frequencies of different signals in the simulation environment.
Now, I want to test this model with the actual encoder signal. I have digital output GPIO pins (that can only output 0V and 3.3V.) Is there a way to monitor this signal real-time?
Note: I am using MATLAB 2017b and I have an oscilloscope.
0 个评论
回答(2 个)
Mark McBroom
2018-3-24
The F28379D device has input capture pins that can be used to measure the frequency of an input signal.
Mark McBroom
2018-4-1
You are limited by the speed of the communication channel. What is the frequency of the signal you are measuring? Why are you using an analog channel? If you only need to measure frequency, you should use an input capture pin. This is a better use of CPU resources than trying to sample a high frequency signal using an A/D.
4 个评论
Rahul Subrahmanian
2022-3-28
编辑:Rahul Subrahmanian
2022-3-28
Hi Mark,
I am not using input capture pin. I need to read a 25kHz sine wave and generate SPWM with respect to that sine wave.
I have created a thread for the issue I am facing.
No one has replied to it yet.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Code Generation and Deployment 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!