MCU
Nordic nRF52840 QFN48
Mandatory GPIO Allocation
Servos
Reserve 5 GPIO outputs:
- SERVO1_PWM
- SERVO2_PWM
- SERVO3_PWM
- SERVO4_PWM
- SERVO5_PWM
Servo Timing Rule
The five servo outputs do not require five independent hardware PWM peripherals.
The nRF52840 PWM hardware may generate multiple servo channels.
GPIO allocation and PWM peripheral allocation are separate resource decisions.
Servo commands may be staggered in firmware to reduce simultaneous battery-current transients.
LoRa — RFM95
Shared SPI
- SPI_SCK
- SPI_MOSI
- SPI_MISO
Dedicated Control Signals
- LORA_NSS
- LORA_RESET
- LORA_DIO0
- LORA_DIO1
RFM95 DIO Allocation Rule
- DIO0 is mandatory.
- DIO1 is strongly preferred.
- Additional DIO pins should only be allocated if required by the selected LoRa firmware/library.
- Do not reserve DIO2–DIO5 unless technically justified.
GNSS — MAX-M10S
Reserve:
- GNSS_TX -> MCU RX
- GNSS_RX -> MCU TX
- GNSS_TIMEPULSE
Use UART as the primary GNSS communication interface.
TIMEPULSE/PPS should be preserved because it may later be used for accurate timing, logging, synchronization, or flight-event correlation.
Sensors
Shared I2C
Reserve:
LSM6DSO32X IMU
Reserve:
The IMU should normally share the main I2C bus.
Do not allocate a dedicated SPI bus to the IMU unless a later performance requirement clearly justifies it.
BMP390 Barometer
Use the shared I2C bus.
No dedicated interrupt GPIO is required initially unless a later design requirement justifies it.
Power Management — BQ25120A
Use the shared I2C bus:
Provisionally reserve:
PMIC_INT should remain available until the BQ25120A functional-block review determines whether the interrupt functionality will actually be used.
Battery Measurement
Reserve:
The MCU should retain the ability to measure raw battery voltage independently through an appropriate resistor divider.
Power Control / Enables
Reserve GPIO provisionally if the final power architecture requires controlled power domains:
- SERVO_POWER_ENABLE
- GNSS_POWER_ENABLE
- LORA_POWER_ENABLE
These signals are optional.
Do not permanently allocate GPIO to them unless the corresponding load switch or controlled power domain is actually implemented.
Avoid unnecessary power switching if it increases complexity or failure risk without meaningful power savings.
USB
A decision is required before final MCU pin allocation.
Possible configurations:
USB data + charging
USB is used for both charging and MCU data/debug functionality.
If USB data is required, reserve the nRF52840:
and include all required support circuitry.
Do not consume the USB pins for other GPIO.
Programming / Debug
Reserve exclusively:
These pins must remain accessible for programming, debugging, board recovery, and firmware development.
Do not reuse SWDIO or SWCLK for normal application functions.
Provide accessible SWD pads or a compact programming connector.
nRF52840 Special-Pin Rules
Before assigning GPIO:
- Preserve SWDIO and SWCLK.
- Do not use NFC pins as normal GPIO unless explicitly approved.
- Preserve crystal-related pins if external LF or HF crystals are used.
- Check SAADC-capable pins before assigning BATTERY_ADC.
- Verify all RF-related pin restrictions.
- Check special-function and high-drive requirements before assigning servo or radio pins.
- Do not assume all nRF52840 GPIO pins are functionally identical.
- Review the nRF52840 datasheet before finalizing the pin map.
- Do not permanently consume pins that may later be needed for low-frequency crystal, USB, NFC, or analog functions unless explicitly justified.
Shared Buses
I2C Bus
Primary shared I2C devices:
- BQ25120A
- LSM6DSO32X
- BMP390
Possible future expansion devices may also use this bus.
Rules:
- Verify address compatibility.
- Use one set of appropriately sized pull-up resistors unless electrical requirements justify otherwise.
- Do not add redundant I2C pull-ups without checking the total effective resistance.
- Keep bus capacitance and PCB routing appropriate for the selected I2C speed.
SPI Bus
Primary SPI device:
Optional future device:
Shared signals:
- SPI_SCK
- SPI_MOSI
- SPI_MISO
Each SPI device receives its own chip-select signal.
Do not create multiple SPI buses unless necessary.
UART
Primary UART device:
Reserve:
The GNSS UART should not be reused for another permanently connected peripheral.
Servo Architecture
Maximum number of servos:
Mandatory:
Optional:
- Servo 2
- Servo 3
- Servo 4
- Servo 5
Preferred servo:
Servo power:
Do not use a servo boost converter.
Do not power servos from the BQ25120A buck output.
Servo control signals:
- five independent MCU GPIO/PWM outputs
PWM is normally generated only when movement is required.
Continuous holding PWM may be used if a specific mechanism requires active holding torque.
Firmware should avoid unnecessarily commanding multiple servos at exactly the same instant.
Where flight timing permits, stagger servo movements slightly to reduce simultaneous battery-current peaks.
Power Rails
The design should conceptually use the following rails:
- USB_5V
- VBAT_RAW
- SERVO_VBAT
- VDD_3V3
- GND
USB_5V
USB charging/input rail.
VBAT_RAW
Direct 1S LiPo battery rail.
Typical operating range approximately:
- 4.2 V fully charged
- down toward the selected safe low-battery cutoff
SERVO_VBAT
Normally derived directly from VBAT_RAW.
Used by CHASERVO LV06 servos.
Do not pass servo current through the BQ25120A buck converter.
VDD_3V3
Main low-noise electronics rail generated by the BQ25120A internal buck converter.
Expected loads include:
- nRF52840
- LSM6DSO32X
- BMP390
- MAX-M10S
- RFM95 if electrically appropriate
- optional SPI flash
- other low-power logic
The final load budget must be checked against the BQ25120A buck-current capability.
Battery / Servo Current Rules
Do not size battery traces, connectors, capacitors, or power routing based only on average servo current.
Servo startup and braking events can create short current peaks.
The design should:
- use low-impedance battery and ground routing
- provide suitable local bulk capacitance on the servo rail
- prevent servo current transients from resetting the MCU
- keep servo-current return paths away from sensitive GNSS, IMU, barometer, and RF circuitry as far as practical
- maintain a common electrical ground while controlling current paths carefully
Optional Flight Data Storage
Optional device:
Use shared SPI if added.
Reserve one chip-select GPIO only if the flash is actually implemented.
Do not allocate a dedicated SPI bus without justification.
The flash is optional and may be omitted if MCU internal flash is sufficient.
Expansion Reserve
Target:
- at least 3 unused GPIO after all mandatory functions are assigned
These spare GPIO should remain genuinely usable and should not conflict with special-function, RF, crystal, USB, or SWD requirements.
Where possible, expose useful expansion interfaces such as:
- I2C
- UART
- spare GPIO
- 3.3 V
- GND
Named Inter-Block Nets
Use consistent named nets for communication between functional blocks.
Recommended names include:
Power
- USB_5V
- VBAT_RAW
- SERVO_VBAT
- VDD_3V3
- GND
I2C
PMIC
SPI / LoRa
- SPI_SCK
- SPI_MOSI
- SPI_MISO
- LORA_NSS
- LORA_RESET
- LORA_DIO0
- LORA_DIO1
GNSS
- GNSS_TX
- GNSS_RX
- GNSS_TIMEPULSE
IMU
Servos
- SERVO1_PWM
- SERVO2_PWM
- SERVO3_PWM
- SERVO4_PWM
- SERVO5_PWM
Optional Power Control
- SERVO_POWER_ENABLE
- GNSS_POWER_ENABLE
- LORA_POWER_ENABLE
Resource Allocation Rules
-
Never allocate a reserved GPIO to another function without explicitly flagging the conflict.
-
Prefer shared I2C and SPI buses instead of creating unnecessary additional buses.
-
Do not consume GPIO for decorative LEDs unless sufficient spare GPIO remains.
-
Preserve SWD access at all times.
-
Servo GPIO must support reliable PWM generation.
-
GPIO allocation and peripheral allocation are separate design decisions.
-
Do not assume that five servo outputs require five hardware timers.
-
Do not allocate optional features before mandatory flight-control resources are secured.
-
Update this resource budget whenever a pin is permanently allocated.
-
Before finalizing the MCU block, produce a complete nRF52840 pin-allocation table.
-
Every assigned MCU pin must be checked against the nRF52840 datasheet.
-
Preserve at least 3 spare GPIO if physically possible.
-
Do not add duplicate regulators, level shifters, buses, pull-ups, or support circuits unless technically necessary.
-
Future functional blocks must use the named nets and existing shared buses wherever practical.
-
If a new requirement conflicts with this resource budget, explicitly flag the conflict before modifying the architecture.
-
Manufacturer datasheets and reference designs take precedence over assumptions generated by AI tools.
-
Do not silently change the system architecture to resolve a pin or peripheral conflict.
-
If an interface requirement is uncertain, preserve the resource until the corresponding functional block has been reviewed.
Functional Block Sequence
The system should be designed and reviewed in this order:
- Power Management — BQ25120A / battery / charging / power rails
- MCU / BLE — nRF52840 / clocks / RF / SWD
- Sensors — LSM6DSO32X + BMP390
- GNSS — MAX-M10S
- LoRa — RFM95
- Servo outputs and servo power distribution
- Optional flash and expansion
- Final top-level integration
For every functional block:
- consider the requirements of all future blocks
- implement only the current block
- preserve resources required by later blocks
- use clearly named inter-block nets
- verify against the manufacturer reference design
- identify unresolved assumptions
- flag architectural conflicts before making changes
- do not silently modify previously reviewed blocks
Final MCU Pin-Allocation Requirement
Before the MCU/BLE block is considered complete, create a full nRF52840 pin-allocation table containing at minimum:
- physical MCU pin
- GPIO name
- assigned function
- hardware peripheral
- functional block
- mandatory or optional status
- analog capability if relevant
- special-pin restrictions
- notes
The pin map must explicitly show:
- all 5 servo outputs
- RFM95 SPI and control signals
- MAX-M10S UART and TIMEPULSE
- shared I2C
- IMU INT1 and INT2
- PMIC interrupt if used
- BATTERY_ADC
- SWDIO
- SWCLK
- USB pins if used
- crystal pins if used
- NFC pins and their status
- all remaining spare GPIO
The final pin map must demonstrate that the complete system can be implemented without unresolved GPIO conflicts.