Help me please in my project(Matlab,Proteus,MikroC Pro)

Thread Starter

Eng_Bandar

Joined Feb 27, 2010
46
Hi all,

I work now in a project contains Matlab, Porteus, MikroC Pro and Virtual Serial Port Driver. My project if I send 'g' letter to PIC 16F877 LED will be turn on. Unfortunately LED not work. I don't know where is the problem.

MikroC Pro Code

Rich (BB code):
char data_1;
void main()
{
trisd=0; // all portb are output
portd=0;
UART1_Init(9600); // speed is 9600
delay_ms(100);
while(1)
{
if(UART1_Data_Ready())
{ // when receiving data
data_1 = UART1_Read(); // read data and store it in variable
if(data_1=='g') {
portd=0B11111111;
delay_ms(500);
portd=0;
delay_ms(500);}
}
}
}


Matlab Code



Rich (BB code):
 s = serial('COM1');
set(s,'BaudRate',9600);
fopen(s);
fprintf(s,'%s','g');
fclose(s)
delete(s)
clear s
Also you can see my vedio to see every thing about this project.

http://www.2shared.com/video/69quZb2C/Untitled2.html
 
Top