hisham.i
Newbie level 5
Hello
I am trying to make an interface between pc and pic16f877A, which allows me to switch a led on and off using a push button.
i made the gui in matlab and programed the bushbutton, and then i wrote the microcontroller program, but while i was simulating it in proteus nothing happens, i didn't recognize the problem.
Also if i press the push button data should be sent to TX pin in the serial port but i recognize that it is sent to CTS pin!
this is my matlab call back connected to the push button:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
s=serial('COM1');
set(s,'baudrate',9600);
fopen(s);
fprintf(s,'%d','h');
fclose(s);
delete(s);
clear s;
I am trying to make an interface between pc and pic16f877A, which allows me to switch a led on and off using a push button.
i made the gui in matlab and programed the bushbutton, and then i wrote the microcontroller program, but while i was simulating it in proteus nothing happens, i didn't recognize the problem.
Also if i press the push button data should be sent to TX pin in the serial port but i recognize that it is sent to CTS pin!
this is my matlab call back connected to the push button:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clear all;
s=serial('COM1');
set(s,'baudrate',9600);
fopen(s);
fprintf(s,'%d','h');
fclose(s);
delete(s);
clear s;