Posts: 154 Threads: 28 Likes Received: 1 in 1 posts Likes Given: 2 Joined: Jun 2020 Reputation: 0 07-Jul-2020, 06:57 PM (This post was last modified: 07-Jul-2020, 07:11 PM by ITGeekLondon.) Hi This DJI Mamba Stack doesn’t have an I2C pad but I’ve heard that some flight controllers have uarts with shared resource so you can use one of the UARTs as i2c Anyone have any experience with this? This is the stack https://www.diatone.us/collections/mamba...ller-stack • Posts: 12,098 Threads: 125 Likes Received: 3,739 in 2,836 posts Likes Given: 99 Joined: Feb 2017 Reputation: 388 You might have to email Diatone to ask. • Posts: 21,413 Threads: 595 Likes Received: 9,037 in 6,688 posts Likes Given: 1,428 Joined: Jun 2018 Reputation: 796 07-Jul-2020, 10:24 PM (This post was last modified: 07-Jul-2020, 10:25 PM by SnowLeopardFPV.) I just took a look at the the unified target resource mappings for the Mamba F722 boards and cross referenced those with the F722 MCU datasheet. There are 4 MCU pins for the Mamba F722 FC's that have been mapped to physical breakout pads on the Mamba F722 board which also have I2C capabilities according to the datasheet. Those pins are as follows:- - UART1 TX (MCU Pin B6) ----> can be remapped to an I2C SCL resource
- UART1 RX (MCU Pin B7) ----> can be remapped to an I2C SDA resource
- UART3 TX (MCU Pin B10) ----> can be remapped to an I2C SCL resource
- UART3 RX (MCU Pin B11) ----> can be remapped to an I2C SDA resource
So in a nutshell you can remap either or both UART1 and UART3 pads to I2C resources on the mamba F722 flight controllers • Posts: 12,098 Threads: 125 Likes Received: 3,739 in 2,836 posts Likes Given: 99 Joined: Feb 2017 Reputation: 388 • Posts: 21,413 Threads: 595 Likes Received: 9,037 in 6,688 posts Likes Given: 1,428 Joined: Jun 2018 Reputation: 796 Yeah, navigating datasheets for MCUs can seem daunting because they are usually hundreds of pages long, but if you know exactly what type of information you're looking for it's not actually too bad finding what you need • Posts: 154 Threads: 28 Likes Received: 1 in 1 posts Likes Given: 2 Joined: Jun 2020 Reputation: 0 (07-Jul-2020, 10:24 PM)SnowLeopardFPV Wrote: I just took a look at the the unified target resource mappings for the Mamba F722 boards and cross referenced those with the F722 MCU datasheet. There are 4 MCU pins for the Mamba F722 FC's that have been mapped to physical breakout pads on the Mamba F722 board which also have I2C capabilities according to the datasheet. Those pins are as follows:-- UART1 TX (MCU Pin B6) ----> can be remapped to an I2C SCL resource
- UART1 RX (MCU Pin B7) ----> can be remapped to an I2C SDA resource
- UART3 TX (MCU Pin B10) ----> can be remapped to an I2C SCL resource
- UART3 RX (MCU Pin B11) ----> can be remapped to an I2C SDA resource
So in a nutshell you can remap either or both UART1 and UART3 pads to I2C resources on the mamba F722 flight controllers ![Smile Smile](https://intofpv.com/images/smilies/smile.png) Snow you are a hero as always but i am actually asking about this board.... https://www.diatone.us/collections/mamba...ller-stack Not the F722 Any chance you could look for that? • Posts: 12,098 Threads: 125 Likes Received: 3,739 in 2,836 posts Likes Given: 99 Joined: Feb 2017 Reputation: 388 You might be out of luck. It looks like the same pin assignment as the F7. But on the F405, there is not a full UART break out for UART 1 or UART 3. • Posts: 21,413 Threads: 595 Likes Received: 9,037 in 6,688 posts Likes Given: 1,428 Joined: Jun 2018 Reputation: 796 08-Jul-2020, 07:14 PM (This post was last modified: 08-Jul-2020, 07:14 PM by SnowLeopardFPV.) ![Doh Doh](https://intofpv.com/images/smilies/custom/doh.gif) I'll make sure I read the requirements properly next time. You could make use of the UART1 pads (remapped as per my previous post) as long as you also disable the software controlled inverter on that UART. The "RC" pad is effectively the SBUS pad or an RX1 pad if you disable the inverter. The (TBS)TX1 pad is the normal TX1 pad with no inverter on it. If you did this you would need to use a different UART for your receiver, and if you are using an FrSky receiver you would also then need to do the uninversion hack for that. Alternatively, if you think you can fly on just two motors then you can remap the MOTOR 2 and MOTOR 3 resources to I2C SCL and I2C SDA resources respectively • Posts: 12,098 Threads: 125 Likes Received: 3,739 in 2,836 posts Likes Given: 99 Joined: Feb 2017 Reputation: 388 Total drop the ball on this one. Good catch. I think I am going to step away. Haha. • Posts: 154 Threads: 28 Likes Received: 1 in 1 posts Likes Given: 2 Joined: Jun 2020 Reputation: 0 There doesn’t seem to be an i2c resource option unless I’m missing something? Using firmware 4.0.5 Can post a pic in the morning but in CLI when I type “resource” then it shows the options of what I can type i2c is not there • Posts: 21,413 Threads: 595 Likes Received: 9,037 in 6,688 posts Likes Given: 1,428 Joined: Jun 2018 Reputation: 796 Just update the FC to Betaflight 4.2. The way resources work was changed in Betaflight 4.1 (and Betaflight 4.2) with the implementation of unified targets. Instead of used resources, you now get a list of all available resources including unused ones. • Posts: 154 Threads: 28 Likes Received: 1 in 1 posts Likes Given: 2 Joined: Jun 2020 Reputation: 0 (08-Jul-2020, 10:28 PM)SnowLeopardFPV Wrote: Just update the FC to Betaflight 4.2. The way resources work was changed in Betaflight 4.1 (and Betaflight 4.2) with the implementation of unified targets. Instead of used resources, you now get a list of all available resources including unused ones. Ok updating betaflight did sort that issue out, but i cannot get it working. It could be that i am not disabling the inverter correctly. But this has two TX1 pads. one inverted and one not. I've tried both (at least i think i have). I have tried setting the addresses to 118 (usually for BMP180) and 119 (usually for the 280 which is what i am using) but still when i enable the barometer and reboot it turns its self back off. So its not seeing it. Here is a diff dump Code: # version # Betaflight / STM32F405 (S405) 4.2.0 Jun 14 2020 / 03:04:22 (8f2d21460) MSP API: 1.43 # config: manufacturer_id: DIAT, board_name: MAMBAF405US, version: cdb02aa1, date: 2020-05-24T03:18:53Z # start the command batch batch start board_name MAMBAF405US manufacturer_id DIAT # resources resource INVERTER 1 NONE resource I2C_SCL 2 B06 resource I2C_SDA 2 B07 # serial serial 0 0 115200 57600 0 115200 serial 3 0 19200 57600 0 115200 # master set acc_calibration = -40,21,-61,1 set baro_bustype = I2C set baro_spi_device = 2 set baro_i2c_device = 2 set baro_i2c_address = 118 set baro_hardware = AUTO set serialrx_provider = CRSF profile 0 rateprofile 0 # end the command batch batch end
and here is a dump of my resources Code: # resource resource BEEPER 1 C13 resource MOTOR 1 A09 resource MOTOR 2 A08 resource MOTOR 3 C09 resource MOTOR 4 C08 resource PPM 1 B09 resource LED_STRIP 1 B03 resource SERIAL_TX 1 B06 resource SERIAL_TX 2 A02 resource SERIAL_TX 3 B10 resource SERIAL_TX 4 A00 resource SERIAL_TX 5 C12 resource SERIAL_TX 6 C06 resource SERIAL_RX 1 B07 resource SERIAL_RX 2 A03 resource SERIAL_RX 3 B11 resource SERIAL_RX 4 A01 resource SERIAL_RX 5 D02 resource SERIAL_RX 6 C07 resource I2C_SCL 2 B06 resource I2C_SDA 2 B07 resource LED 1 C15 resource LED 2 C14 resource SPI_SCK 1 A05 resource SPI_SCK 2 B13 resource SPI_SCK 3 C10 resource SPI_MISO 1 A06 resource SPI_MISO 2 B14 resource SPI_MISO 3 C11 resource SPI_MOSI 1 A07 resource SPI_MOSI 2 B15 resource SPI_MOSI 3 B05 resource ESCSERIAL 1 B09 resource CAMERA_CONTROL 1 B08 resource ADC_BATT 1 C01 resource ADC_RSSI 1 C02 resource ADC_CURR 1 C03 resource PINIO 1 B00 resource FLASH_CS 1 A15 resource OSD_CS 1 B12 resource GYRO_EXTI 1 C04 resource GYRO_CS 1 A04
What am i missing here? • Posts: 21,413 Threads: 595 Likes Received: 9,037 in 6,688 posts Likes Given: 1,428 Joined: Jun 2018 Reputation: 796 (09-Jul-2020, 08:46 AM)ITGeekLondon Wrote: What am i missing here? You need to release the UART resource assignments for those two MCU pins because only one resource can use the pins and UART ownership takes precedent over I2C ownership. So run the following commands... Code: resource SERIAL_TX 1 NONE resource SERIAL_RX 1 NONE save
• Posts: 154 Threads: 28 Likes Received: 1 in 1 posts Likes Given: 2 Joined: Jun 2020 Reputation: 0 (09-Jul-2020, 11:24 AM)SnowLeopardFPV Wrote: You need to release the UART resource assignments for those two MCU pins because only one resource can use the pins and UART ownership takes precedent over I2C ownership. So run the following commands... Code: resource SERIAL_TX 1 NONE resource SERIAL_RX 1 NONE save
That still didnt work. Just going to try soldering to the other pad and try again. • Posts: 21,413 Threads: 595 Likes Received: 9,037 in 6,688 posts Likes Given: 1,428 Joined: Jun 2018 Reputation: 796 Can you please also run the "resource show all" CLI command and post the results back here. • |