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.

Matlab serial transmit problem

Status
Not open for further replies.

niddss

Newbie level 1
Joined
Nov 16, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pakistan
Activity points
1,289
hi!
I am trying to transmit data from MATLAB to PIC16F887 microccontroller...
Data is being transmitted to Microcontroller through hyperterminal without any error, but when I run following code in MATLAB:
s = serial('COM1');
set(s,'DataBits',8);
set(s,'BaudRate',9600);
set(s,'Parity','none');
set(s,'StopBits',1);
set(s,'FlowControl','none');
fopen(s)
fwrite(s,5);
fclose(s)
delete s
clear s
...I get the error 'Empty state-space model.'
Is there any error in the above code??
kindly help!
 

try this...

s = serial('COM1','BaudRate',9600);
fopen(s);
%wait for some time
fprintf(s,"5");


% i mean to say try fprintf and in "5"

Try
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top