User.1
User.1

Reputation: 2642

USB UART speed is wrong

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

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 ?

Upvotes: 0

Views: 1071

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283694

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:

Upvotes: 2

Related Questions