Hi Am trying to send data from PIC16F877A to PC via serial port.
To read the data fro the serail port using matLab i have done the following code.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
v=instrfind
fclose(v);
clc;
clear;
clc;
s = serial('COM1');
s.InputBuffersize=500;
s.BaudRate=9600;
fopen(s);
set(s,'Parity','mark','DataBits',8);
out=fread(s,2,'uint8');
save MyObject s;
load MyObject s;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
But thevariable 'out' is getting different values during each time i run the code eventhough am sending only one value. WHY??
Also am getting only a matrix of decimal value and not Binary...
PLS HELP ME!!
This is really urgent for our project....