madflight FC1 - RP2350B Flight Controller

Schematic

Buy

Specifications

madflight FC1

  • MCU: RP2350B with 48 GPIO, 32 GPIO accessible via pinheader
  • Gyro/Acc: ICM-42688-P
  • Magnetometer: QMC6309
  • Barometer: HP203B
  • Batery Monitor: INA226
  • Black Box: MicroSD (1-bit SPI or 4-bit SDIO)
  • PSRAM: Optional (empty SO-8 socket on back of board)
  • Dimensions: 57.6 x 42 mm
  • Weight: 7.5 gr (without pins, DC-DC)

Optional DC-DC Converter

  • Output: 5V 2A continous / 3A peak
  • input: 6.5~20V
  • Dimensions: 20 x 10 x 5 mm
  • Weight: 1.8 gr

Arduino IDE Setup

madflight for FC1 requires arduino-pico v4.x.x

Start the Arduino IDE and select menu Tools->Board Manager to install this software.

For programming, select "Solder Party RP2350 Stamp XL"

PlatformIO Setup

Clone or download the madflight repository from GitHub.

Start PlatformIO, press the "Import Arduino Project" button, and import a madflight example.

Adapt the platformio.ini file as follows:

; PlatformIO Project Configuration File for madflight

[env]
; Set this to the folder where madflight.h is located
; Default locations when installed via the Arduino IDE:
;    Windows: C:\Users\{username}\Documents\Arduino\libraries\madflight
;    macOS:   /Users/{username}/Documents/Arduino/libraries/madflight
;    Linux:   /home/{username}/Arduino/libraries/madflight

lib_extra_dirs = /ENTER/MADFLIGHT/FOLDER/HERE

; RP2040/RP2350 is not merged into mainline PlatformIO, see 
; https://arduino-pico.readthedocs.io/en/latest/platformio.html
; on Windows you need to enable long path names, see above link for instructions

[env:madflight_pico2]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico2
framework = arduino
board_build.core = earlephilhower

Pinout FC1

This is the default FC1 configuration, the external pins can be reconfigured.

Use #include <madflight_FC1.h> instead of #include <madflight_board.h> to include this pinout.

GPIO External Pin Function Internal Function
0 SER0_TX (connect to radio receiver RX)
1 SER0_RX (connect to radio receiver TX)
2 I2C1_SDA (connect to GPS SDA)
3 I2C1_SCL (connect to GPS SCL)
4 SER1_TX (connect to GPS RX)
5 SER1_RX (connect to GPS TX)
6 free
7 OUT0 (connect to ESC for motor 1)
8 free
9 OUT1 (connect to ESC for motor 2)
10 free
11 OUT2 (connect to ESC for motor 3)
12 free
13 OUT3 (connect to ESC for motor 4)
14 free
15 OUT4
16 free
17 OUT5
18 free
19 OUT6
20 free
21 OUT7
22 free
23 free
24 free
25 free
26 MAG_INT
27 IMU_INT
28 SPI1_MISO (imu)
29 IMU_CS
30 SPI1_SCLK (imu)
31 SPI1_MOSI (imu)
32 I2C0_SDA (bar,bat,mag)
33 I2C0_SCL (bar,bat,mag)
34 SDIO_CLK/SPI0_SLCK (bbx)
35 SDIO_CMD/SPI0_MOSI (bbx)
36 SDIO_D0/SPI0_MISO (bbx)
37 SDIO_D1 (bbx)
38 SDIO_D2 (bbx)
39 SDIO_D3/SPI0_CS (bbx)
40 free (ADC)
41 free (ADC)
42 free (ADC)
43 free (ADC)
44 free (ADC)
45 free (ADC)
46 BAR_INT
47 QMI_CS1 (for optional PSRAM)

RP2350B Hardware

RP2350B is the 80 pin / 48 gpio variant of the Raspberry Pi RP2350 processor.

RP2350 has dual core processor, plus dual single precision FPUs.

madflight uses float and is much happier with RP2350 than with RP2040 !

madflight uses a custom Serial library, because the default Arduino Serial transmitter blocks after sending a couple bytes. Something we don't want.

madflight uses FreeRTOS and executes the 1000Hz IMU loop on the second core. The first core is used for the other sensors.

madflight Limitiations

  • BBX: SDCARD only with SPI interface (not with MMC/SDIO interface)
  • OUT: Consecutive even/odd PWM pins (e.g. pins 2,3 or 10,11) share the same timer and have the same frequency.