Society of Robots - Robot Forum

Software => Software => Topic started by: hendrachubby on October 12, 2009, 05:26:18 PM

Title: Help recieve data from PC
Post by: hendrachubby on October 12, 2009, 05:26:18 PM
Hi all,

i can send data to PC but i can't send data to PC, here is my program :

Code: [Select]
#pragma used+
char recieve_serial_2(void)
{
char status,data;
while (1)
      {
      while (((status=UCSR2A) & RX_COMPLETE)==0);
      data=UDR2;
      if ((status & (FRAMING_ERROR | PARITY_ERROR | DATA_OVERRUN))==0)
      return data;
      };
}
#pragma used-


for testing i try to send a char to toggle my PORT and turn on a LED but it still not working, like this :

Code: [Select]
while (1)
    {
        if (recieve_serial_2() == A)
        {
            PORTD.5 = 1;
        }
    }

thx all for the help
Title: Re: Help recieve data from PC
Post by: walkercreations on October 12, 2009, 07:47:06 PM
Hi all,

i can send data to PC but i can't send data to PC, here is my program :

...

...


You might wanna rephrase that?
Title: Re: Help recieve data from PC
Post by: hendrachubby on October 12, 2009, 07:48:41 PM
ooh im sorry,

i can send data to my PC

but i can't send data from my PC to uC