Hi everyone, I have a Jhemcu play F4 which i am trying to add a barometer to (yes, the ever popular nano-longrange fad )
I found a few tips on how to add I2C devices, but of course nothing for this particular FC. I figured the process should be like this:
1. Determine which pins can be used for I2C on this CPU (STM32F411CEU6). According to the datasheets
I2C #1 can use PB6 or PB8 for SCL, PB7 or PB9 for SDA
I2C #2 can use PB10 for SCL, PB9 or PB3 for SDA
I2C #3 can use PA8 for SCL and PB4 for SDA
Of those available pins, only I2C #2 PB9 and PB10 were available on this board, others assigned to various functions. Is that the correct way of looking at it? (The betaflight I2C tutorial i found online just said "refer to your board's pinout")
2. Then take a deep breath, and solder some enamel wires to those pins on the FC (which i somehow managed to do).
3. Now, enable the pins in CLI:
(PPM 1 was set to B10 originally)
4. Finally, solder up a 5V BMP280 (https://www.aliexpress.com/item/32817286611.html?)... Is this where i stuffed up? Should this be the 3.3v version? No Barometer detected in Betaflight, but Status CLI returns "i2c errors: 0"
Does anyone have any experience with this, can you tell me if my process was wrong here? I hope my pin selection is correct because i now have a glob of E6000 over the wires for strain relief...
I found a few tips on how to add I2C devices, but of course nothing for this particular FC. I figured the process should be like this:
1. Determine which pins can be used for I2C on this CPU (STM32F411CEU6). According to the datasheets
I2C #1 can use PB6 or PB8 for SCL, PB7 or PB9 for SDA
I2C #2 can use PB10 for SCL, PB9 or PB3 for SDA
I2C #3 can use PA8 for SCL and PB4 for SDA
Of those available pins, only I2C #2 PB9 and PB10 were available on this board, others assigned to various functions. Is that the correct way of looking at it? (The betaflight I2C tutorial i found online just said "refer to your board's pinout")
2. Then take a deep breath, and solder some enamel wires to those pins on the FC (which i somehow managed to do).
3. Now, enable the pins in CLI:
Code:
resource PPM 1 NONE
resource I2C_SCL 2 B10
resource I2C_SDA 2 B09
set baro_i2c_device = 2
set baro_i2c_address = 118
set baro_hardware = BMP280
(PPM 1 was set to B10 originally)
4. Finally, solder up a 5V BMP280 (https://www.aliexpress.com/item/32817286611.html?)... Is this where i stuffed up? Should this be the 3.3v version? No Barometer detected in Betaflight, but Status CLI returns "i2c errors: 0"
Does anyone have any experience with this, can you tell me if my process was wrong here? I hope my pin selection is correct because i now have a glob of E6000 over the wires for strain relief...