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.

Can MATLAB be used to program a pic 16f877?

Status
Not open for further replies.

extradeath

Member level 2
Joined
Nov 26, 2004
Messages
44
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
Alexandria, Egypt, Egypt
Activity points
390
Can we use MATLAB

Dear friend, can we use MATLAB to program a pic 16f877

Can we write a program using MATLAB functions that it is converted HEX file....

If so, please reply....

Added after 3 minutes:

Waiting your help.....
 

Re: Can we use MATLAB

By my knowledge:
NO

But perhaps there are ways

Matlab is great for developping techniques, algorithms and for debugging.
Once you have then it should no be that difficult to convert your code to C.
The biggest challenge will probably be the data structures.
Keep in mind that you're programming for microcontrollers which don't have allot of RAM ;-)

Antharax
 

Re: Can we use MATLAB

NO you CAN'T in your PARTICULIAR CASE !
MATLAB generates C code but that code is mostly tight to libraries that you need to LINK ..of course these libs are meant for the pc enviroment..

So out of the question of using MATLAB internal SUPER optimazed libs to get their C code to program a micro controller .
One example the function fft() .. is imposible to recover pure C code for this function . You will get some SKELETON calling some functions in some DLLs ..
You can do some independant c code generation .. but .you won't be able to USE what matlab is good for ..
With TOOLKITs like for Ti DSP and other .is possible to convert THOSE blocks or modules that have been inplemented without using the MATLAB internal LIBRARY

One main reason why is not possible to generate full C code from matlab is that MATLAB is not even written in C but in C++ . But on top can you IMAGINE being able to recover MATLAB SOURCES !! they are not crazy abou it!!
 

Can we use MATLAB

I canitfully understand you..eltonjohn about using fft() because I'm looking for a way to use this certain function....

please help me and make it more easier to understand.....

By the way can we find something to convert Matlab program to C
 

Re: Can we use MATLAB

Ok you see MATLAB generates C code just for some matrix operations
but MATLAB has a very RICH internal library of functions. I used the example of fft() .Becasuse i like you was naive to think that i will get that piece of code .
But once i studied the code i saw that instead i got calls to a lot of DLL's that's why you have to have microsoft C compiler installed .
Finally yes you ended up with a program that runs on the PC ..and was c code generated ..but that's all you CAN't port those higly OPTIMAZED MATLAB functions
to a micro ..BECAUSE you will never get the code !..
The only way is to make a function in MATLAB called myfft() and not to use any internal matlab function .. Well that defeats the purpose of matlab !
Then is better to write it in C DIRECTLY and much more optimazed ..
though you will loose the SIMULATION capability .
That's why every manufaturer installes it's own set of function that he supports .
because yes he can give you C code for his MODULES .. matlab won't!

cheers
 

Re: Can we use MATLAB

The difficult part is not about getting the code or algo. It's all over google. The challenge lies in implmenting it on a uC with memory and speed constraints, and still give a reasonable bandwidth. There is one project called picspect which has accomplished fft. You can google for it. But it's in asm. C is simply too slow for fft.
 

You can set connection between matlab and pic through serial connection and transfer data, if this is what you asked for.
But since "programming pic" is something different,you may not be able to do that.I can not say impossible since I didnt try it before.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top