The Godfather talking
You may crack software. How about me?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 24, 2024, 10:52:03 10:52


Login with username, password and session length


Pages: [1]
Print
Author Topic: micro to matlab serial comunication  (Read 4002 times)
0 Members and 1 Guest are viewing this topic.
hamid9543
Active Member
***
Offline Offline

Posts: 124

Thank You
-Given: 80
-Receive: 7


« on: April 19, 2014, 06:47:35 06:47 »

hi .
can you help me for conect picmicro (ccs) to matlab with serial comunication?
Logged
xpress_embedo
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 122
-Receive: 254


« Reply #1 on: April 21, 2014, 03:16:43 03:16 »

What problem you are facing in doing so??

Just use PIC Micro-Controller UART and RS232 Line Driver IC such MAX3232/MAX232 to send data on PC, instead of receiving on Hyper-Terminal program of windows, use MATLAB to receive data.

First of all you have to Open the Communication Port.

The Following Command Creates a Serial Port Object associated with COM1 and will set its Baud Rate = 9600 bps
Code:
 s = serial('COM1','BaudRate',9600);

Then you have to open this port, the command is as follow:-
Code:
fopen(s)

To Send a String to RS232 Port:
Code:
fprintf(s,'Sonsivri');

To Receive Data from RS232 Port in MATLAB
Code:
fgets(s)

To Close the Port
Code:
flcose(s)
delete(s)

I am also attaching some links with tutorial on MATLAB Serial Based Communication, apart from that refer MATLAB Documentation, everything is properly explained in that document.
« Last Edit: April 21, 2014, 03:22:48 03:22 by xpress_embedo » Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC