How to write at specific memory location of C2000 using Matlab Function in Siumulink Embedded Coder?

조회 수: 6 (최근 30일)
Currently I am using "Memory Copy" block of Embeded Coder Support Package for Texas Instrumnets C2000 Processors to write at or to read from peripheral registers of F2837xD devices. Is it possible to do the same with 'MATLAB function block'? If yes, then what is the code to do the same?

채택된 답변

Venkatesh Chilapur
Venkatesh Chilapur 2019년 6월 25일
Hi Sumit,
One apporach is to define the register access in a 'c' function in a 'c' source file.
You can then call this function from Matlab Function block using ceval Matlab routine.
Make sure to add this 'c' source file in the custom code section. - Look for 'Specify Source Code and Dependencies' at link below:
HTH,
Regards,
Venkatesh C
  댓글 수: 1
Roberto Aceiton
Roberto Aceiton 2020년 10월 15일
Hi Venkatesh,
I am currently trying to achieve the same thing, however I am not sure I understand your solution. Could you maybe provide a simple working example?
Regards,
Roberto.

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

추가 답변 (0개)

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by