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.

how can program the pic by using matlab?

Status
Not open for further replies.

solidsnike

Member level 1
Joined
Apr 16, 2006
Messages
37
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,526
Is it possible to use the matlab program to program the pic ,, if this okay can i get informations about this:?: I hope you can help me and give me any data or info. about this subj. ,, i need your help very much

note: the intrfacing by paralell port and i use the PIC16F84 micro controller

thanks
 

Are you tied to MATLAB?

What exactly are you doing with your PIC16F84?

Is it possible to use other softwares and ports?

Cheers,
 

I can give you certain ideas (not implemented but can try):

1) As you are using Parallel Port, you can run the *.exe from matlab. So use any dosbase programmer available on the net which accepts the command line arguments. Make one Batch file and call that batch file from matlab. (You can even convert the batch file to exe and then run from matlab.)
2) You can use convert the existing C-Code for the PIC Programmer (available on net from some sites), convert it into *.max file and use it with matlab.
3) At the end I suggest you to change the interface to serial port and use any available bootloader and then transmitt the hex code to the PIC using the MATLAB.

I hope this would be helpful to you, but the third suggesting would not be possible if you are using PIC16F84. Any ways you can try to find the bootloader for that.

Best of luck.
 

2) You can use convert the existing C-Code for the PIC Programmer (available on net from some sites), convert it into *.max file and use it with matlab.

how can convert the c or c++ code to code or functions that used in Matlab >>> i know that i can compiler the functions of matlab to C++ language but i wanna the opposite way from the C++ to matlab

thanks for ur answers
 

Hi solidsnike,

Let me try to clarify your question.

Are you wanting to get your piece of code (for PIC) into the chip from MATLAB?
or
Are you wanting to produce some code (for PIC, of course) by using MATLAB?

Cheers,
 

solidsnike said:
how can convert the c or c++ code to code or functions that used in Matlab >>> i know that i can compiler the functions of matlab to C++ language but i wanna the opposite way from the C++ to matlab

hi
you must use mex function.
compile C code into dll and use it.
regards
 

Are you wanting to get your piece of code (for PIC) into the chip from MATLAB?
or
Are you wanting to produce some code (for PIC, of course) by using MATLAB?

i want code (for PIC) into the chip from MATLAB by using the functions of the matlab program ... if i can get some way to convert another code as assembly or C++ to these functions or call it by using mex function but i dont know how i do this ... if there are some websites that help me how can i call C++ code or assembly by mex function

thanx for all ...

solidsnake
 

solidsnike said:
Are you wanting to get your piece of code (for PIC) into the chip from MATLAB?
or
Are you wanting to produce some code (for PIC, of course) by using MATLAB?

i want code (for PIC) into the chip from MATLAB by using the functions of the matlab program ... if i can get some way to convert another code as assembly or C++ to these functions or call it by using mex function but i dont know how i do this ... if there are some websites that help me how can i call C++ code or assembly by mex function

thanx for all ...

solidsnake
Right,

You have a couple of options (I don't know how to do it, just some thoughts).
First, if you can access your parallel port through MATLAB, there are source codes of working softwares that you can learn from those about programming the chip by accessing parallel port.

Second, if you can access your serial port through MATLAB (I'm sure this option is possible), there are also some source codes of working softwares that you can learn from those about programming the chip by accessing serial port.

Those source codes are usually written in C or C++, so they could be ported to MATLAB.

Cheers,
 

hello namqn ,

my projec in paralell port >

thanks all for help >> i will try call C , C++ codes by mex function .
if someone has any books or references about this subject i will appreciate that ...

Thanks again and with my best regards to you
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top