Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add a FAQ section.
  • Loading branch information
kaklik committed Feb 14, 2024
1 parent 23102e0 commit 0d3f9d3
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# TFI2CADT01 - I²C address translator

TFI2CADT01 is I2C device address changer. This function allows you to connect multiple I2C devices with the same address to one master device at the same bus.
TFI2CADT01 is an I2C device address changer. This function allows you to connect multiple I2C devices with the same address to one master device on the same bus.

![TFI2CADT01A PCB design](/doc/img/TFI2CADT01A_booth_sides.jpg)

That is a common problem in case multiple I2C sensors with the same address (or a limited number of addresses) needs to by connected to one I2C master. The purpose of this module is to change the address with which I2C master calls to the address of the target I2C (slave) device.
Module is based on [LTC4317](https://www.analog.com/media/en/technical-documentation/data-sheets/4317fa.pdf) I2C address traslator IC.
The module is designed and optimized for use on Pixhawk compatible drones especially UAVs. The design of the module is compatible with the [dronecode connectors standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-009%20Pixhawk%20Connector%20Standard.pdf).
That is a common problem in case multiple I2C sensors with the same address (or a limited number of addresses) need to be connected to one I2C master. The purpose of this module is to change the address with which the I2C master calls to the address of the target I2C (slave) device.
The module is based on [LTC4317](https://www.analog.com/media/en/technical-documentation/data-sheets/4317fa.pdf) I2C address translator IC.
The module is designed and optimized for use on Pixhawk-compatible drones, especially UAVs. The design of the module is compatible with the [dronecode connectors standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-009%20Pixhawk%20Connector%20Standard.pdf).



Expand All @@ -17,11 +17,11 @@ ThunderFly I2C address translator is commercially available from [ThunderFly s.r

## Translation function

The called address of slave device is translated by a logical operation [XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) with the address bits configured in the TFI2CADT01 module. Each TFI2CADT01 port has a different default address. The address of each port can be changed independently by soldering a solder jumper.
The called address of the slave device is translated by a logical operation [XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) with the address bits configured in the TFI2CADT01 module. Each TFI2CADT01 port has a different default address. The address of each port can be changed independently by soldering a solder jumper.

## Configuration

Default address translation is listed in following table.
The default address translation is listed in the following table.

| Port | Solder jumper | XOR value (in hex) | XOR value in binary form |
|---|---|---|---|
Expand All @@ -32,21 +32,21 @@ Default address translation is listed in following table.

### Determining the new address of the I2C device

The new device address which should be called by master could be calculated easily. Just take the the original device address and do an XOR with the TFI2CADT01 port address. The result is the new device address. For example, you can use an [online calculator](https://xor.pw/).
The new device address which should be called by master could be calculated easily. Just take the original device address and do an XOR with the TFI2CADT01 port address. The result is the new device address. For example, you can use an [online calculator](https://xor.pw/).

## Example of usage

The TFI2CADT01 could be used with a wide variety od ThunderFly or Pixhawk I²C sensors, here are few examples.
The TFI2CADT01 could be used with a wide variety of ThunderFly or Pixhawk I²C sensors, here are a few examples.

### TFRPM tachometer sensor

The TFI2CADT01 could be easily used to connection of multiple [TFRPM01](https://github.com/ThunderFly-aerospace/TFRPM01) sensors, which is especially useful of multi-rotor airframes.
The TFI2CADT01 could be easily used for the connection of multiple [TFRPM01](https://github.com/ThunderFly-aerospace/TFRPM01) sensors, which is especially useful for multi-rotor airframes.

![TFI2CADT01A using multiple TFRPM01 sensors](/doc/img/TFI2CADT01_multi_TFRPM01.jpg)

### TFSLOT airspeed sensor

The TFI2CADT01 could also fix troubles with connection of multiple [TFSLOT01](https://github.com/ThunderFly-aerospace/TFSLOT01) airspeed sensors to one bus. That could increase the redundancy, in situation where failure of sensor is more probable than failure of the bus itself.
The TFI2CADT01 could also fix troubles with the connection of multiple [TFSLOT01](https://github.com/ThunderFly-aerospace/TFSLOT01) airspeed sensors to one bus. That could increase the redundancy, in situations where a failure of the sensor is more probable than failure of the bus itself.

![TFSLOT airspeed sensor](https://raw.githubusercontent.com/ThunderFly-aerospace/TFSLOT01/TFSLOT01A/doc/img/TFSLOT_1_small.jpg)

Expand All @@ -56,3 +56,20 @@ The TFI2CADT01 could also fix troubles with connection of multiple [TFSLOT01](ht
[TFHT01](https://github.com/ThunderFly-aerospace/TFHT01) connected by use of TFI2CADT01 allows measuring of temperature and humidity by multiple sensors at once.

![TFHT01](https://raw.githubusercontent.com/ThunderFly-aerospace/TFHT01/TFHT01B/doc/img/TFHT01A2.jpg)

## FAQ

### How I can change the I2C addresses used in the Pixhawk to the ones translated by the TFI2CADT01?

The translated addresses might not be recognized by default in the PX4 (that is usually experienced in the case of the SDP3x sensor driver).
One approach to solve that is to create a configuration file named `config.txt` on the SD card as is documented in the [PX4 documentation](https://docs.px4.io/main/en/concept/system_startup.html#replacing-the-system-startup). In this file, you can specify the start commands for the driver of the translated sensors.

Here's an example of the content of the `/etc/config.txt` on the SD card:

```
sdp3x_airspeed start -X -a <translated_address_a>
sdp3x_airspeed start -X -a <translated_address_b>
```

Replace `<translated_address_a>` and `<translated_address_b>` with the actual translated I2C addresses of your sensors. Addresses could be obtained by calculating XOR with the original address. Or it can be obtained with the `i2cdetect` command.

0 comments on commit 0d3f9d3

Please sign in to comment.