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 gui for serial communication of PIC 16f877a

Status
Not open for further replies.

jerkymotion

Member level 4
Joined
Oct 12, 2010
Messages
73
Helped
28
Reputation
56
Reaction score
28
Trophy points
1,298
Location
NEPAL
Activity points
1,824
hi everyone, i need help
I want to develop GUI in MATLAB and perform serial communication with PIC 16f877a..for example if click a button in gui then it must send simple command that should flash a led by Microcontroller...
please help...every help will be appreciated
 

nikhilele

Advanced Member level 3
Joined
Jan 11, 2006
Messages
805
Helped
101
Reputation
202
Reaction score
76
Trophy points
1,308
Location
Bangalore India
Activity points
6,375
JUST GO THROUGH THIS

%% Using MATLAB with Serial Devices (such as RS-232)
% MATLAB supports communication with serial devices including RS-232 when
% using the Instrument Control Toolbox. There are many devices with serial
% interfaces, including gas chronometers, mass spectrometers,
% imaging devices, pulse oximeters, and instruments.
%
% The toolbox provides a graphical tool that allows you to configure,
% control, and acquire data from your serial device without writing code.
% The tool automatically generates MATLAB code that allows you to reuse
% your work. The code example below was automatically generated by the
% tool. Type "tmtool" at the MATLAB command line to launch this tool.
%
% This code example below shows you how you can communicate with your
% serial device using MATLAB. The "*IDN?" command was used which is a
% typical command for communicating with an instrument. The commands you
% can use will depend on what your serial device supports.

%% Automatically generating a report in MATLAB
% Press the "Save and Publish to HTML" button in the MATLAB Editor to
% execute this code example and automatically generate a report of your
% work with the serial device.

%% Automatically generating MATLAB script for your RS-232 device
% To automatically create your own MATLAB script, launch "tmtool". Open the
% "Hardware" node, open the "Serial" node, select your serial port (such
% as COM1, press the "connect" button. Once connected, enter your device
% commands in the right pane, press "Session log" to see the code generated,
% and press "Save Session" to save the code to a MATLAB (.m) file.

%% MATLAB script automatically generated for the RS-232 device
% The following MATLAB script was automatically generated by interacting
% with the device configuration tool provided by the toolbox.

% Creation time: 03-Oct-2006 20:36:43

% Create a serial port object.
obj1 = instrfind('Type', 'serial', 'Port', 'COM3', 'Tag', '');

% Create the serial port object if it does not exist
% otherwise use the object that was found.
if isempty(obj1)
obj1 = serial('COM3');
else
fclose(obj1);
obj1 = obj1(1)
end

% Connect to instrument object, obj1.
fopen(obj1);

% Communicating with instrument object, obj1.
data1 = query(obj1, '*IDN?');

% Disconnect from instrument object, obj1.
fclose(obj1);

% Clean up all objects.
delete(obj1);
 

jerkymotion

Member level 4
Joined
Oct 12, 2010
Messages
73
Helped
28
Reputation
56
Reaction score
28
Trophy points
1,298
Location
NEPAL
Activity points
1,824
ok i want to make the gui in c# for both transmitting and recieving the data ......
when recieving it must be able to plot the real time graph as well while recieving the data
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top