Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

serial communication using matlab

Status
Not open for further replies.

soinarose

Junior Member level 3
Joined
Oct 7, 2009
Messages
27
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
india
Activity points
1,462
sir,

i want to display a wave from function generator in matlab. i convert analog signal using adc. The microcontroller which im using is PIC 16F877A. my plan is to transmit it through serial port.. hw can i receive data through serial port...

Pls help me..
Sonia.
 

bassa

Super Moderator
Staff member
Joined
Jul 15, 2007
Messages
1,811
Helped
191
Reputation
402
Reaction score
153
Trophy points
1,353
Location
Sri Lanka
Activity points
10,228
soinarose said:
sir,

i want to display a wave from function generator in matlab. i convert analog signal using adc. The microcontroller which im using is PIC 16F877A. my plan is to transmit it through serial port.. hw can i receive data through serial port...

Pls help me..
Sonia.
Hi,

Matlab examples available in the "Math Works web" you may browse their web for more information.

Create serial port object in matlab

What Is the MATLAB Serial Port Interface

Guide to Serial Port Interfacing

hope this helps

regards
bassa
 

    soinarose

    points: 2
    Helpful Answer Positive Rating
    V

    points: 2
    Helpful Answer Positive Rating

soinarose

Junior Member level 3
Joined
Oct 7, 2009
Messages
27
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
india
Activity points
1,462
Thank u for ur valuable information.. im getting values from PIC... but after some time its automatically closed... im getting an warning ..

Warning: The input buffer was filled before the Terminator was reached.


pls help me sir to solve this error....

Regards
Sonia..[/b]
 

bassa

Super Moderator
Staff member
Joined
Jul 15, 2007
Messages
1,811
Helped
191
Reputation
402
Reaction score
153
Trophy points
1,353
Location
Sri Lanka
Activity points
10,228
soinarose said:
Thank u for ur valuable information.. im getting values from PIC... but after some time its automatically closed... im getting an warning ..

Warning: The input buffer was filled before the Terminator was reached.


pls help me sir to solve this error....

Regards
Sonia..[/b]
Hi,

I think before you read the data from matlab, try to read it using hyper terminal, if this test is fine then check your matlab code

check math works web for this error. here some links

Problem reading lines from a serial device

Also check chapter 5 "Controlling Serial Port Instruments" of Instrument Control Toolbox here attached

good luck!

regards
bassa
 

soinarose

Junior Member level 3
Joined
Oct 7, 2009
Messages
27
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
india
Activity points
1,462
sir, im getting datas in hyper terminal...
 

cavelli

Newbie level 1
Joined
Feb 11, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
spain
Activity points
1,286
Hi, i want to use the serial port with matlab for i can read the sensors data. i'm using the next comand:

port=serial ('COM1', 'BaudRate',9600,'DataBits',8,'StopBits',1);
fprintf(port,'%c','%1');
[tline,count,msg}=fgetl(port);
fclose(port);
delete(port);
clear(port);

But "tline" parameter only show me one character and "count" only count one.

Why?

Thanks.
 

rongo024

Advanced Member level 4
Joined
Dec 29, 2008
Messages
111
Helped
21
Reputation
42
Reaction score
19
Trophy points
1,298
Location
Bangladesh
Activity points
1,806
You need not go through any microcontroller.
Matlab can interface audio in .So just put your analog signal at your audio in and read the value at this port.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top