Effacer les filtres
Effacer les filtres

How to set up a Simulink model to use external clock on my Arduino Mega 2560?

5 vues (au cours des 30 derniers jours)
Alexander Babin
Alexander Babin le 10 Août 2020
Modifié(e) : Alexander Babin le 11 Août 2020
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

Réponses (0)

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by