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.

Problem in sending data through serial port

Status
Not open for further replies.

barathwaj555

Newbie level 5
Joined
Sep 28, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,355
I am using matlab 2010b version.
s=serial('COM6','BaudRate',9600);
fopen(s);
fprintf(s,'b');
output = fscanf(s);
I used this codeto sent data to P89v51rd2 microcontroller. but i didnt get any response in the controller. The matlab shows busy when this code is executed. i used
unsigned char a;
P1=0x00;
a=RX();
if(a=='b')
P1_3=1;
i used this code in tric compiler to burn in the controller.
the specified pin doesnt show 1.
Can anyone tel me the reason???
 

You may try this code (comment the code line "output = fscanf(s);")

Code:
s = serial('COM6'); 
set(s,'BaudRate',9600);
fopen(s);
tx='b';  
fprintf(s,'%s',tx);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top