Simulink Raspberry Code Generation Running Very Slow

조회 수: 8 (최근 30일)
Burak
Burak 2025년 1월 9일
댓글: Amish 2025년 3월 26일

I am trying to compile a simple gpio trigger signal that I created with Simulink and run it on the raspberry. But unfortunately, when I measure with an oscilloscope from the gpio pin, which should trigger 2khz, I see a 2hz measurement. I would appreciate if you can help with this. It is interesting that even very simple models have such problems. (Matlab2024a)

  댓글 수: 1
Amish
Amish 2025년 3월 26일
Hi Burak,
A few debugging steps that I could suggest:
  1. Verify the sample time of the blocks in your Simulink model as it can affect the frequency of the output signal.
  2. Set the solver type to Fixed-step and choose a fixed-step size that matches your desired sample time (e.g., 0.0005 seconds for 2 kHz).
  3. In the Hardware Implementation pane, ensure that the hardware board is set to Raspberry Pi. Make sure you are deploying the model correctly to the Raspberry Pi.
  4. Ensure that the GPIO block in your Simulink model is configured correctly. Double-check the pin number and mode.
I hope these might help you resolve the issue.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Raspberry Pi Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by