Dear All, I am working on a project that consists of a RC CAR controlled over the internet by WiFi. I am using PIC16F887 and the Control Interface on the PC is VB.NET . I take data into the PIC through Serial RS232. when i Use ISIS professional to simulate the PIC with a simple LED and i link ISIS and VB.NET , the PIC receives Data but nothing happens and the LED doesn't turn on, so i thought there is something wrong in my code .( i am not very smart in microcontroller programming , here is a part of the code, please help)
void main()
{
again:
init();
Reception_loop:
if(OERR==1)
{RCSTA=0b10000000;
goto again;
}
if(RCIF==1)
{x1=RCREG-30;
x2=RCREG-30;
}
else
goto Reception_loop;
The x1= rcreg-30 and x2=rcreg-30 i thought i had to write -30 because VB sends String type . and the PIC receives 2 characters one after the other, so i save them in x1 and then x2.
In the init() function i wrote:
RCSTA=0b10010000;
TXSTA=0b00100100;
BAUDCTL=0b00001000;
SPBRG=832;
please try to help me
void main()
{
again:
init();
Reception_loop:
if(OERR==1)
{RCSTA=0b10000000;
goto again;
}
if(RCIF==1)
{x1=RCREG-30;
x2=RCREG-30;
}
else
goto Reception_loop;
The x1= rcreg-30 and x2=rcreg-30 i thought i had to write -30 because VB sends String type . and the PIC receives 2 characters one after the other, so i save them in x1 and then x2.
In the init() function i wrote:
RCSTA=0b10010000;
TXSTA=0b00100100;
BAUDCTL=0b00001000;
SPBRG=832;
please try to help me