High frequency generation ( 100K ) and above using Simulink and deploying it on Arduino

7 views (last 30 days)
I trying to experment with simulink and interface it with arduino , my goal is to generate high frequency , but there is a limit and i know I saw a high frequency generated by arduino before , but how , is there any tutorial .
Walter Roberson
Walter Roberson on 25 Aug 2022
I am not clear on what it is that you wish to have happen at 100K? Is that 100K samples per second input? If so then how many channels, how many bits per channel, and what is the the acceptable latency?
Or is it a pwm output signal? If so then how frequently does it need to change pattern? If it is reacting to input, then how much latency of reaction is acceptable?

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 16 Aug 2022
If you are using the USB connector, and if you are transfering each sample individually, not many people manage to get more than 40 Hz or so. The theoretical limit is 1000 packets per second (with roughly 1000 bytes of data each time.)
If you are using an ethernet connection, the theoretical rate is significantly higher. I do not know what the practical limit is.
Some people are getting higher serial port rates with add-on ports; https://www.avrfreaks.net/forum/mega2560-board-usb-connection-speed
  1 Comment
MUSTAFA on 19 Aug 2022
Can u please put a link for hardware and any other detachment that will be needed for this , another question after getting all of these ,can I still use simulink for flushing the codes , or there more thinks i may need to do in order to use the simulink , thanks

Sign in to comment.

Arun Kumar
Arun Kumar on 25 Aug 2022
Edited: Arun Kumar on 25 Aug 2022
Hi Mustafa,
Don you mean the PWM frequency?
If yes, then you can specify the PWM frequency in the PWM block by selecting the specify option.
Hope this helps!
Arun Kumar
Arun Kumar on 25 Aug 2022
In MATLAB 2020a and later releases, it is possible to generate PWM with higher frequencies on Arduino.
Simply change the desired frequency parameter of the PWM block.
Some pins have certain limitations which is mentioned in the following page: https://www.mathworks.com/help/supportpkg/arduino/ref/pwm.html
Hope this helps.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!