0

The GUI on the PC sends a set of bytes to an embedded system.

  • Bluetooth adapter, all fine
  • USB cable, all wrong.

Device is a FTDI USB TTL Serial Cable

(vendor's product page here)

We need a predictable speed. I send out one thing from the PC, but I'm seeing either 0x00 or 0x80 bytes in the UART (receive buffer) on the embedded system.

This is the C# statement that sends the bytes...

    connectorPort.Write(Protocol.Our_Command_04_Start_Data, 0, Protocol.Our_Command_04_Start_Data.Length);

115200 worked, but it isn't fast enough.

I need to make that look like a 921600 bps signal. 460800 bps might get me by; maybe. We are using flow control (CTS/RTS) on this port on the embedded system.

Is there a way to get the UART, with C#, to do one of those speeds ? How ?

User.1
  • 2,562
  • 3
  • 33
  • 40

1 Answers1

2

I've run FTDI chips at various unusual speeds when 115200 is not sufficient, including 921600 and 500000 bps. Using the Win32 API, there's no special handling required, just set the desired baud rate in the device control block you pass to SetCommState.

If you're using (System.IO.Ports.SerialPort) you have additional restrictions. You'll save yourself many headaches if you pretend that class doesn't exist.

FTDI has a very useful Application Note AN_120 Aliasing VCP Baud Rates which provides information that may help you.

  • Describing rates that can be exactly generated by the FTDI baud rate generator
  • Describing the registry settings to remap a "standard" baud rate onto something higher:
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • where, how, what, do I set set to do the device control block ? I need to tell my GUI expert who wrote that – User.1 Mar 18 '13 at 19:32
  • @User.1 I added a link to SetCommState. – Ben Voigt Mar 18 '13 at 19:35
  • That manual has the way to do it ? I just tried setting it myself in Devices and printers (blah blah blah) and I'm still getting nulls. 115200 is the only one that seems to work – User.1 Mar 18 '13 at 19:43