Incoming USB characters lost

12 ビュー (過去 30 日間)
Gavin
Gavin 2025 年 5 月 1 日
コメント済み: Gavin 2025 年 11 月 4 日 22:45
I have an Arduino Pico connected to MATLAB and I use Terminated (CR/LF) trigger to read the input. Each message is about 10 to 12 characters and they come in at random intervals of a few seconds but potentially as fast as a few ms apart. It works 99% of the time or so but I am losing some character packets. It appears that if I am also writing data to disk that USB packets get dropped more often. Is there a way to make sure data isn't lost?
  3 件のコメント
Andrei
Andrei 2025 年 5 月 28 日
Gavin, please contact MathWorks Support to investigate the issue.
Gavin
Gavin 2025 年 11 月 4 日 22:45
Although every line sent ends with CR/LF terminator. Later invertigation has shown that the string arrived and is sitting in the Serial port's input buffer. I did a work around where the Arduino Pico sends an extra CR/LF if it doesn't hear from ML in a while (a few seconds) indicating that it's hung up. So far that's working.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by