Author Topic: Help recieve data from PC  (Read 979 times)

0 Members and 1 Guest are viewing this topic.

Offline hendrachubbyTopic starter

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 0
Help recieve data from PC
« 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

Offline walkercreations

  • Full Member
  • ***
  • Posts: 90
  • Helpful? 1
Re: Help recieve data from PC
« Reply #1 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?
Peter Walker
Fruitland, MD USA

Offline hendrachubbyTopic starter

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 0
Re: Help recieve data from PC
« Reply #2 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

 


Get Your Ad Here

data_list