Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Programming microcontroller using matlab

Status
Not open for further replies.

MD_SHAHRUKH

Advanced Member level 4
Full Member level 1
Joined
Jun 5, 2017
Messages
103
Helped
4
Reputation
8
Reaction score
5
Trophy points
1,298
Location
Bangalore, India
Activity points
2,388
Hello everyone,
Is it possible to program microcontroller using matlab. There is an option of generating C code for the matlab code but it is not diresctly compatible with the microcontroller. arduino boards are directly programmed through the Matlab, can other microcontrollers also be programmed similarly or there limited controllers which can be done that way. Another thing is, suppose I have created a PID controller block diagram and want to generate that PID algorithm, how to do this. please help!

thank you
 

As you might know, MATLAB is a tool intended to deal primarily with numerical computation, so its purpose is to make calculations for a given set of parameters. Even if the tool were able to make generating of C code outputs, there is no impediment to you embeed those function within your program by your own (being C a structured languagem you just inject values to the function argument, and get the returned result). A C compiler in other hand is a tool which not only allow standard C language, but also several specific settings, optimizations and linkages that is not the role of MATLAB. I would rather expect IDEs of microcontroller`s manufacturers providing plugin to MATLAB, instead of the opposite, anyway sounds as an unlikely feature to hope.
 

Sir, should I ask to the matlab forum for the algorithm generation or can you help me that how can i generate the C code out of the simulink model?
 

Your initial question was another one, and the answer given was related to it:

Is it possible to program microcontroller using matlab

Now, you are asking another question:

generate the C code out of the simulink model

And in that case from now you should wait for an answer from someone who has experience with this. Anyway, a quick search on the Web gave the answer, took few seconds from a query and we can easily find this 'official' tutorial:

 
I also turned to the tutorial, but it's a pretty better to start with C programming to write the program text, then I use the compilers. And if there is a compilation error, I seek the help of knowledge from more experienced

programmers https://www.assignmentexpert.com/programming/computer-science-project (if to take into account the production scales and not only one particular 1 microcontroller),

you can create, edit and digest the code written by me, achieving the optimal workflow.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top