How to set up a Simulink model to use external clock on my Arduino Mega 2560?
7 views (last 30 days)
Show older comments
Hi, all, I have an Arduino board all configured, two potentiometers connected to it at the same time, pins A0 and A1, however, simulation runs a lot slower than real time. It is funny, but it seems, the lower the sampling frequency, the faster the simulation time. For instance, it takes about 13 to 14 seconds to simulate 1 second of data acquisition. It takes about a second to run 18 seconds of simulation with sampling frequency about 10 Hz. The samples appear in scope in real time, but the X axis is off, that irritates me, and I am afraid it will also hinder adequate data acquisition. I have read that you can configure external clock in older versions of Matlab, but I cant find this option in R2019b.
If you happen to know how to configure my board to run in real-time, please, do share!
Best regards, Alex
UPD. It seems that sampling is affected somehow, i only get 350 samples a second (the real-time second) with sampling freq 1000 Hz
0 Comments
Answers (0)
See Also
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!