title: i want to transmit data from avr to pc.whats wrong in below connection or code
body: <p>connection:
  USB to TTL interface modules four pins:
  1)0v-volt of avr
  2)vcc-5 volt avr
  3)TXD-TX of avr
  4)RXD-RX of avr
  and the USB to TTL serial interface module connected to PC using USB to RS-232 convertor DB9 cable.</p>
  
  <p>below is the code:</p>
  
  <pre><code>    #include&lt;avr/io.h&gt;
  
  void UART_transmit(unsigned char data);
  
  int main(void)
  
  {
  
      unsigned char i,message[]="i love india\r\n";
      DDRD=0x00;
      PORTD=0xFF;
      UCSRA=0;
      UCSRB=1&lt;&lt;TXEN; // transmitter enable
      UCSRC=1&lt;&lt;URSEL | 1&lt;&lt;UCSZ1 | 1&lt;&lt;UCSZ0; // 8 data bit, a stop, none parity
      UBRRH=0;
          UBRRL=5; // for 9600 baud at 1MHz
  
          while(1)
  
          {
  
          for(i=0;message[i];i++)
  
  
  
       {
  
          UART_transmit(message[i]);
  
          }
  
          } // while(1) end
  
          } // main() end
  
  void UART_transmit(unsigned char data)
  {
    while(!(UCSRA &amp; (1&lt;&lt;UDRE)));
    UDR=data;
  }
  </code></pre>