mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 03:41:35 +08:00
docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
It is recommended for:
|
||||
|
||||
* Connecting offboard components that require low bandwidth and low latency communication, e.g. [rangefinders](../sensor/rangefinders.md), [magnetometers](../gps_compass/magnetometer.md), [airspeed sensors](../sensor/airspeed.md) and [tachometers](../sensor/tachometers.md).
|
||||
* Compatibility with peripheral devices that only support I2C.
|
||||
* Allowing multiple devices to attach to a single bus, which is useful for conserving ports.
|
||||
- Connecting offboard components that require low bandwidth and low latency communication, e.g. [rangefinders](../sensor/rangefinders.md), [magnetometers](../gps_compass/magnetometer.md), [airspeed sensors](../sensor/airspeed.md) and [tachometers](../sensor/tachometers.md).
|
||||
- Compatibility with peripheral devices that only support I2C.
|
||||
- Allowing multiple devices to attach to a single bus, which is useful for conserving ports.
|
||||
|
||||
I2C allows multiple master devices to connect to multiple slave devices using only 2 wires per connection (SDA, SCL).
|
||||
in theory, a bus can support 128 devices, each accessed via its unique address.
|
||||
@@ -15,7 +15,6 @@ in theory, a bus can support 128 devices, each accessed via its unique address.
|
||||
UAVCAN would normally be preferred where higher data rates are required, and on larger vehicles where sensors are mounted further from the flight controller.
|
||||
:::
|
||||
|
||||
|
||||
## Wiring
|
||||
|
||||
I2C uses a pair of wires: SDA (serial data) and SCL (serial clock).
|
||||
@@ -29,7 +28,6 @@ To ensure reliable communication and to reduce crosstalk it is advised to apply
|
||||
|
||||

|
||||
|
||||
|
||||
## Checking the Bus and Device Status
|
||||
|
||||
A useful tool for bus analysis is [i2cdetect](../modules/modules_command.md#i2cdetect).
|
||||
@@ -41,8 +39,8 @@ The tool can be run in the PX4 terminal with the following command:
|
||||
```
|
||||
i2cdetect -b 1
|
||||
```
|
||||
where the bus number is specified after `-b` parameter
|
||||
|
||||
where the bus number is specified after `-b` parameter
|
||||
|
||||
## Common problems
|
||||
|
||||
@@ -62,8 +60,9 @@ The bandwidth available for each device generally decreases as more devices are
|
||||
If too many devices are added, it can cause transmission errors and network unreliability.
|
||||
|
||||
There are several ways to reduce the problem:
|
||||
* Dividing the devices into groups, each with approximately the same number of devices, and connecting each group to one autopilot port
|
||||
* Increase bus speed limit (usually set to 100kHz for external I2C bus)
|
||||
|
||||
- Dividing the devices into groups, each with approximately the same number of devices, and connecting each group to one autopilot port
|
||||
- Increase bus speed limit (usually set to 100kHz for external I2C bus)
|
||||
|
||||
### Excessive Wiring Capacitance
|
||||
|
||||
@@ -71,9 +70,10 @@ The electrical capacity of bus wiring increases as more devices/wires are added.
|
||||
The problem can be analyzed using an oscilloscope, where we see that the edges of SDA/SCL signals are no longer sharp.
|
||||
|
||||
There are several ways to reduce the problem:
|
||||
* Dividing the devices into groups, each with approximately the same number of devices, and connecting each group to one autopilot port
|
||||
* Using the shorter and higher quality I2C cables, see the [cable wiring page](../assembly/cable_wiring.md#i2c-cables) for details
|
||||
* Separating the devices with a weak open-drain driver to smaller buses with lower capacitance by using [I2C Bus Accelerators](#i2c-bus-accelerators)
|
||||
|
||||
- Dividing the devices into groups, each with approximately the same number of devices, and connecting each group to one autopilot port
|
||||
- Using the shorter and higher quality I2C cables, see the [cable wiring page](../assembly/cable_wiring.md#i2c-cables) for details
|
||||
- Separating the devices with a weak open-drain driver to smaller buses with lower capacitance by using [I2C Bus Accelerators](#i2c-bus-accelerators)
|
||||
|
||||
## I2C Bus Accelerators
|
||||
|
||||
@@ -81,6 +81,7 @@ I2C bus accelerators are separate circuits that can be used to support longer wi
|
||||
They work by physically dividing an I2C network into 2 parts and using their own transistors to amplify I2C signals.
|
||||
|
||||
Available accelerators include:
|
||||
|
||||
- [Thunderfly TFI2CEXT01](https://docs.thunderfly.cz/avionics/TFI2CEXT01/):
|
||||

|
||||
- This has Dronecode connectors and is hence very easy to add to a Pixhawk I2C setup.
|
||||
@@ -89,7 +90,7 @@ Available accelerators include:
|
||||
### I2C Level Converter function
|
||||
|
||||
Some I2C devices have 5V on the data lines, while the Pixhawk connector standard port expects these lines to be 3.3 V.
|
||||
You can use the TFI2CEXT01 as a level converter to connect 5V devices to a Pixhawk I2C port. This feature is possible because the SCL and SDA lines of TFI2CEXT01 are 5V tolerant.
|
||||
You can use the TFI2CEXT01 as a level converter to connect 5V devices to a Pixhawk I2C port. This feature is possible because the SCL and SDA lines of TFI2CEXT01 are 5V tolerant.
|
||||
|
||||
## I2C Address Translators
|
||||
|
||||
@@ -112,6 +113,6 @@ Software development for I2C devices is described in [I2C Bus (Development Overv
|
||||
|
||||
## Further Information
|
||||
|
||||
* [I2C](https://en.wikipedia.org/wiki/I%C2%B2C) (Wikipedia)
|
||||
* [I2C Comparative Overview](https://learn.sparkfun.com/tutorials/i2c) (learn.sparkfun.com)
|
||||
* [Driver Framework](../middleware/drivers.md)
|
||||
- [I2C](https://en.wikipedia.org/wiki/I%C2%B2C) (Wikipedia)
|
||||
- [I2C Comparative Overview](https://learn.sparkfun.com/tutorials/i2c) (learn.sparkfun.com)
|
||||
- [Driver Framework](../middleware/drivers.md)
|
||||
|
||||
Reference in New Issue
Block a user