NinjaFlight
|
Cleanflight has enhanced serial port flexibility but configuration is slightly more complex as a result.
Cleanflight has the concept of a function (MSP, GPS, Serial RX, etc) and a port (VCP, UARTx, SoftSerial x). Not all functions can be used on all ports due to hardware pin mapping, conflicting features, hardware, and software constraints.
UART is the most efficient in terms of CPU usage. SoftSerial is the least efficient and slowest, SoftSerial should only be used for low-bandwidth usages, such as telemetry transmission.
UART ports are sometimes exposed via on-board USB to UART converters, such as the CP2102 as found on the Naze and Flip32 boards. If the flight controller does not have an on-board USB to UART converter and doesn't support VCP then an external USB to UART board is required. These are sometimes referred to as FTDI boards. FTDI is just a common manufacturer of a chip (the FT232RL) used on USB to UART boards.
When selecting a USB to UART converter choose one that has DTR exposed as well as a selector for 3.3v and 5v since they are more useful.
Examples:
Both SoftSerial and UART ports can be connected to your computer via USB to UART converter boards.
Serial port configuration is best done via the configurator.
Configure serial ports first, then enable/disable features that use the ports. To configure SoftSerial ports the SOFTSERIAL feature must be also be enabled.
If the configuration is invalid the serial port configuration will reset to its defaults and features may be disabled.
You can use the CLI for configuration but the commands are reserved for developers and advanced users.
The serial
CLI command takes 6 arguments.
The allowable baud rates are as follows:
Identifier | Baud rate |
---|---|
0 | Auto |
1 | 9600 |
2 | 19200 |
3 | 38400 |
4 | 57600 |
5 | 115200 |
6 | 230400 |
7 | 250000 |