All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Embedded Systems and Microcontrollers

Notices

Embedded Systems and Microcontrollers Discussion forum for projects and working with embedded systems and microcontrollers (FPGAs, PICs, AVRs). Get help with hardware issues and embedded programming.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 12-17-2009, 12:03 PM
walid el masry's Avatar
walid el masry walid el masry is offline
Senior Member
 
Join Date: Mar 2009
Location: Mansoura , EGYPT
Posts: 132
Send a message via MSN to walid el masry Send a message via Skype™ to walid el masry
Default help : write a microcontroller program from matlab

is that true that i can write a program to a microcontroller from matlab tool box cause some program will be easy to be written with matlab tool box instead assembly and c either and if that possible is there any examples for this operation assuming we program for pic microcontroller take PIC16F877A as an example
Reply With Quote
  #2  
Old 12-17-2009, 01:30 PM
russ_hensel russ_hensel is offline
Senior Member
 
Join Date: Jan 2009
Location: South Dartmouth Ma
Posts: 812
Default

I doubt it unless you mean use it as a text editor.
Reply With Quote
  #3  
Old 12-17-2009, 01:55 PM
walid el masry's Avatar
walid el masry walid el masry is offline
Senior Member
 
Join Date: Mar 2009
Location: Mansoura , EGYPT
Posts: 132
Send a message via MSN to walid el masry Send a message via Skype™ to walid el masry
Default

no no not like a text editor what i mean is similar to what matlab 2009 do with FPGA when it convert what i wrote in matlab to VHDL code so that i can download it on FPGA so what i want here is to write a program in matlab specially using the simulink or tool box of matlab and then download it on a microcontroller
Reply With Quote
  #4  
Old 12-17-2009, 02:28 PM
Papabravo's Avatar
Papabravo Papabravo is online now
Senior Member
 
Join Date: Feb 2006
Location: Michigan, USA (GMT-5)
Posts: 5,522
Default

I know of no such product. In part this is due to the extreme mismatch between matlab operations and the capabilities of a typical microcontroller which may have to do a multiply or divide without the benefit of a hardware instruction. In addition the limited amounts of RAM would make matrix operations quite limited.

There may be interpreted languages that are suitable for download and execution on a microcontroller, but matlab and simulink would not be my first choice.

What are you trying to accomplish exactly?
__________________
We never have time to do it right,
But we always have time to do it over.
Reply With Quote
  #5  
Old 12-17-2009, 02:52 PM
walid el masry's Avatar
walid el masry walid el masry is offline
Senior Member
 
Join Date: Mar 2009
Location: Mansoura , EGYPT
Posts: 132
Send a message via MSN to walid el masry Send a message via Skype™ to walid el masry
Default

about what i want to do i intent to measure the frequency , capacitance & inductance and i have been told that matlab simulink have a stong ability to do that so i thought if i wrote the program on matlab and download it on a microcontroller it will be a great way with a high efficiency to accomplish that
Reply With Quote
  #6  
Old 12-17-2009, 03:01 PM
Chaabane Chaabane is offline
Junior Member
 
Join Date: Nov 2009
Posts: 37
Default

Hello,
read this,its the same question i guess
http://www.mathworks.com/matlabcentr..._thread/265159

what i know is that you can use simulink to interfere with your real system (AC motor,...) .
Using a system called Dspace , so you can simulate filters,modulators,... in simulink and control a real system.
but you can use a pic with simulink,for example:you need to send a feedback to your pic, using an expensive non-linear filter,and you're not sure if this will work or not,why wasting money !! use simulink to simulate this filter...
Reply With Quote
  #7  
Old 12-17-2009, 03:48 PM
walid el masry's Avatar
walid el masry walid el masry is offline
Senior Member
 
Join Date: Mar 2009
Location: Mansoura , EGYPT
Posts: 132
Send a message via MSN to walid el masry Send a message via Skype™ to walid el masry
Default

Quote:
what i know is that you can use simulink to interfere with your real system
what i want to do is to interface the real system usin a microcontroller with a program written with simulink and burnt on the microcontoller

Quote:
you can use a pic with simulink,for example:you need to send a feedback to your pic
you mean that the feedback is done by a program written b simulink and executed on the pc but what i want is to reduce the need of the pc and depend only on the microcontroller to reduce the size and cost

what i really want is the feature of the matlab using the microcontroller
Reply With Quote
  #8  
Old 12-17-2009, 11:06 PM
Papabravo's Avatar
Papabravo Papabravo is online now
Senior Member
 
Join Date: Feb 2006
Location: Michigan, USA (GMT-5)
Posts: 5,522
Default

I'm sorry but I think this is a quest which is not grounded in reality. If you can figure out a way for a microcontroller to run matlab or simulink code you'll be well on your way to a promising career.
__________________
We never have time to do it right,
But we always have time to do it over.
Reply With Quote
  #9  
Old 12-18-2009, 08:34 AM
walid el masry's Avatar
walid el masry walid el masry is offline
Senior Member
 
Join Date: Mar 2009
Location: Mansoura , EGYPT
Posts: 132
Send a message via MSN to walid el masry Send a message via Skype™ to walid el masry
Default

i don't mean it that way i mean run matlab or simulink code with the limitation of the hardware of the microcontroller will better 100 times from writing a program from the scratch in assembly even in c it is like using the predefined library in c instead of writing your own in assembly even in c
Reply With Quote
  #10  
Old 12-18-2009, 04:26 PM
Papabravo's Avatar
Papabravo Papabravo is online now
Senior Member
 
Join Date: Feb 2006
Location: Michigan, USA (GMT-5)
Posts: 5,522
Default

Let us start with some basic information.

Matlab and Simulink are interpreted languages. What does this mean? It means there is a program, the matlab interpreter, that takes as input a string representing a statement. An example would be the definition of a 3x3 matrix
Code:
A = [1, 2, 3 ; 4, 5, 6 ; 7, 8, 9]
Select All
From this string the matlab interpreter would define and initialize a data structure to contain the 3x3 array named "A". Next consider a statement to take the inverse of A. The matlab interpreter would look at the string:
Code:
AINV = inv(A)
       or
AINV = A^-1
Select All
and invoke the intrinsic procedure for inverting the matrix A

In order for matlab to be executable on a microcontroller there must either be a matlab interpreter that runs on the microcontroller that can interpret matlab statements, or there must be a compiler on the PC which can compile matlab statemnts into executable code for the microcontroller of interest. There are no other ways of doing this.

What I am saying is that there are unlikely to be matlab interpreters for microcontrollers, and there are unlikely to be compilers that will compile matlab statements into executable code for microcontrollers. If there is a counter example to my assertions then let the lucky party please step forward and help the OP.
__________________
We never have time to do it right,
But we always have time to do it over.
Reply With Quote
Reply   Post New Thread

Tags
, , ,


Related Site Pages
Section Title
Textbook Microprocessor programming : Principles Of Digital Computing


Similar Threads
Thread Thread Starter Forum Replies Last Post
matlab burning & circuit electronics for program sockets electronics1 Programmer's Corner 2 09-11-2009 01:27 PM
Useful Matlab Information Dave Programmer's Corner 7 11-09-2008 05:51 AM
how to write program interrupts or design interrupts. cholriak Programmer's Corner 1 09-13-2006 08:44 AM
HELP! 16*2 LCD interface with HC11 tsl83 General Electronics Chat 2 11-12-2005 09:06 PM
HELP! 16*2 LCD interface with HC11 tsl83 Programmer's Corner 1 11-11-2005 04:52 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.