increasing the sampling frequency in simulink to read input pulses from digital (PWM) pin of arduino

3 ビュー (過去 30 日間)
Hi,
I am reading the pulses coming out of a motor to the digital pin of Arduino Uno. The number of pulses that i am getting from the motor are around 20000. But i am not able to count these many pulses in simulink via arduino. Simulink shows very few pulses. Can anyone please tell me the how can i count all the pulses that are fed to digital pin (PWM) of arduino Uno. Or in other words how can i increase the sampling frequency in simulink to count all the pulses.

採用された回答

Arun Kumar
Arun Kumar 2021 年 9 月 30 日
Hi Aakash,
The sampling frequency is limited by the microtroller clock frequency which is avr in this case.
A good way to capture the incoming pulse is to use external interrupt block.
If your end goal is to measure frequency/duty cycle, consider using Input capture block.
HTH!
Thanks,
Arun
  1 件のコメント
aakash dewangan
aakash dewangan 2021 年 10 月 26 日
編集済み: aakash dewangan 2021 年 10 月 26 日
Thanks Arun for help :)
Knowledge of clock freq helped here.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSwitches and Breakers についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by