Why does my device driver not work?

조회 수: 1 (최근 30일)
Manuel Reimer
Manuel Reimer 2020년 12월 26일
댓글: Manuel Reimer 2021년 1월 1일
I want to create my own device driver Sink to drive custom external hardware.
I thought as a simple starting point it may be a good exercise to replicate an existing block (in my case the Servo block).
I did the best I can but for some reason just nothing happens on my Arduino Uno...
As I have no plan at all on how to debug, I don't even know where to start to find the reason.
Maybe someone could try this out. The servo data pin is meant to be attached to pin 9 on an Arduino Uno. My code is attached.

답변 (1개)

Nikhil Sonavane
Nikhil Sonavane 2020년 12월 30일
You may refer to the following documentation and verify if you followed the same procedure-
  댓글 수: 1
Manuel Reimer
Manuel Reimer 2021년 1월 1일
Thanks for your answer.
The tutorial is for MATLAB 2020 only. So some stuff like architecture detection differs significantly on older releases. After some hours of googling I found a possible solution for MATLAB 2019 which is the version I have to use.
Finally I found the missing stuff by using Simulink Coder to find out where the build settings differ with my self-made "Servo" block and the "official" Servo block in the Arduino Support package. I didn't find out where the magic happens with those build settings in the official Arduino support packages as this seems to be an MathWorks internal secret hidden in many useless P-Code files.
This is all very inconvenient. I have to use Simulink to directly program hardware in a project from my university which bases on the stuff shipped with the "Arduino Engineering Kit Revision 1". This works as long as you follow the textbook but documentation lacks heavily once you try to do something beyond the stuff that is prepared in existing support packages.
Why are the Arduino support packages for Simulink and Matlab not completely open sourced?? In my opinion this is heavily against the Arduino philosophy. The installed support package contains many "P-Code" files which can't be read and so can't be used to learn how your stuff actually has to be used for own projects. Your support package bases on open source Arduino libraries, so your own stuff can only be code that "glues" the open sourced stuff to the Simulink environment. By hiding this information you make it much more difficult to create own hardware support implementations!
From what I've learned so far, I think Simulink Hardware support is nice for universities to be used in control engineering laboratories, but I clearly wouldn't choose it for real projects.

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

카테고리

Help CenterFile Exchange에서 Device Driver Blocks에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by