title: FTDI chip USB to serial converter sending bytes over RX
body: <p>I'm programming a serial communication for a microcontroller, and using UART for this. To connect to UART I'm using a USB to serial Converter wich include a FTDI chip. The issue is that the TX <strong>and RX</strong> are sending bytes (tested with Salea Logic). How is this possible? For sending bytes I used WriteFile, as it's described in MSDN.</p>
  
  <p>Thanks for helping!</p>
  
  <pre><code>char bytes_to_send[5];
  bytes_to_send[0] = 0x48;
  bytes_to_send[1] = 31;
  bytes_to_send[2] = 31;
  bytes_to_send[3] = 31;
  bytes_to_send[4] = 13;
  
  HANDLE hComm;
  hComm = CreateFile(L"COM4", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
  
  if (hComm == INVALID_HANDLE_VALUE) {
      std::cout &lt;&lt; "error\n";
  }
  else {
      std::cout &lt;&lt; "connected \n";
  
      DCB dcbParams = { 0 };
  
      dcbParams.BaudRate = CBR_115200;
      dcbParams.ByteSize = 8;
      dcbParams.fParity = NOPARITY;
      dcbParams.StopBits = ONESTOPBIT;
      dcbParams.fDtrControl = DTR_CONTROL_ENABLE;
      if (!SetCommState(hComm, &amp;dcbParams))
      {
          printf("ALERT: Could not set Serial Port parameters");
      }
      else
      {
  
          //Flush any remaining characters in the buffers 
          PurgeComm(hComm, PURGE_RXCLEAR | PURGE_TXCLEAR);
          //We wait 2s as the arduino board will be reseting
          Sleep(4000);
          std::cout &lt;&lt; "everything is ok... \n";
  
  
          DWORD bytes_written, total_bytes_written = 0;
          fprintf(stderr, "Sending bytes...");
          if (!WriteFile(hComm, bytes_to_send, 5, &amp;bytes_written, NULL))
          {
              fprintf(stderr, "Error\n");
              CloseHandle(hComm);
              return 1;
          }
          std::cout &lt;&lt; "all bytes sent" &lt;&lt; std::endl;
  
          //Flush any remaining characters in the buffers 
          PurgeComm(hComm, PURGE_RXCLEAR | PURGE_TXCLEAR);
          char buffer[255];
          DWORD bytesRead;
  
          /*while (int i=ReadFile(hComm, buffer, 1, &amp;bytesRead, NULL)) {
              std::cout &lt;&lt; "Bytes read" + (char)i &lt;&lt; std::endl;
              std::cout &lt;&lt; buffer &lt;&lt; std::endl;
          }*/
  
  
  
      }
  
  }
  </code></pre>