The Godfather talking
Share your stuff or I will make you regret it.
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2016, 02:48:13 02:48


Login with username, password and session length


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

Posts: 120

Thank You
-Given: 45
-Receive: 3


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

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

Posts: 153

Thank You
-Given: 103
-Receive: 188


WWW
« Reply #1 on: April 21, 2014, 04:16:43 04: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, 04:22:48 04: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