Posted on

UARTs on Flight Controllers – huh?

So this is an opinion. There are some facts to back up my ideas, but mostly it’s about my thoughts.

As I write this in June 2022, it’s less than a year since I cracked open the box on my first real flight controller (a PixRacer R15), flashed ArduPilot and started figuring out how this magical technology works.

In many ways though, I’m not a complete novice, I’ve been working in IT for more than 35 years, I wrote my first computer programs around 40 years ago. I’ve built working computers from chips, components and solder and I’ve assembled and connected many of them over the years, but I am new to RC flying, flight controllers and autonomous flying.

So when I heard about UARTs being used to connect other components to flight controllers in 2022, I assumed this would be some kind of new, leading edge technology. Boy was I wrong!

Back in the 1980’s I used to connect serial terminals to Linux hosts (we didn’t call them servers in those days). They would be connected via point to point RS-232C cables and a fast terminal would run at 38,400 baud.

Wyse 60 serial computer terminal – 38400 baud

So it turns out that UART stands for “Universal Asynchronous Receive/Transmit” – and it’s basically the same thing as RS-232, which is a standard from the 1960s. RS-232 and RS-485 are both different kinds of UART! The only difference is that flight controller UART’s run slightly faster, a standard PixHawk UART runs at 57,600, but that’s barely faster than the old fashioned green screen serial terminals we used to used back in the LAST CENTURY!

This is unbelievably slow. The old standard flight controller UART speed for a PixHawk was 57,600. 57K baud is the speed a fast dialup modem internet connection used to be in the 1990’s.

The new standard UART speed seems to be “115,200”, about double – which is is about 115k bits per second. Yes K, not mega or even giga – its 115k bits per second!!! (or about 11 Kbytes per second).

Even the slowest USB 1.0 connection is capable of 12Mbps and modern USB3.0 can do 5Gbps – which is between 100 and 44,000 times faster than a UART if I have my math right. Other alternatives commonly used are i2c, CAN, and SPI – all massively faster than UART and – since I didn’t say it clearly yet:

A UART is a point to point protocol. Each port can connect one and only one device!!!

  • Even the lowly i2c can support multiple devices on a single flight controller port.
  • CAN is specifically a bus based protocol that is designed to daisy chain multiple devices off a single port.
  • SPI is also a bus style interface that supports multiple devices connecting to a single port and running at “up to” 60 Mbps although limited to “short distances”. Most Flight Controllers seem to have an SPI port but it rarely gets used. Why is that?
  • Most Flight Controllers have at least 1 and sometimes two USB connections able to run at “USB speeds”, which could be connected to a USB hub allowing multiple devices.
  • The H743 processor (and most H7 class processors) have embedded Ethernet. Why do so few boards surface this high speed interface?

I’ve just ordered a new Benewake TFmini-I (CAN) LIDAR which has a default baud rate of 250k. Still a lot faster than a UART.

So why do flight controllers use UARTs?

Even more than that – why do flight controllers have so many UARTs? It seems to be a momentum thing, but I just don’t get why the community isn’t demanding more.

The ZealotH743 has 2x i2c ports and 2x CAN ports and 1 SPI port which can all support multiple devices- but there are 5 UARTS!!! Such a lot of output port real estate is wasted on UARTS!

50% of the space used by UART ports!

I will have to use a UART to connect the Express LRS receiver I just bought – but why? There have to be better options. Some flight controllers are now being delivered with “built in” Express LRS receivers. These use on-board SPI interfaces to connect to the ELRS receiver, so this begs the question – why can’t external Express LRS boards come with SPI which is available an most flight controllers?

Most flight controllers have i2c, CAN, SPI and USB connectors – all MUCH faster than UART, and all capable of connecting multiple devices to a single port. Not to mention fiber optics. Why are fiber optic interfaces at fiber optic speeds not available on flight controllers?

Not much needs a UART, Digital Airspeed sensors are available as i2c and CAN, Lidars as i2c and CAN, even ESCs can be connected via CAN, CAN based GPS modules are available, companion computers such as the Raspberry PI could use Ethernet to talk to the flight controller if it was supported by the flight controller.

So this is my big question – why, in 2022, is UART still being used for connecting peripherals to flight controllers?