MCU Pinout & Requirements

MCU Selection

Below are the minimum requirements for the MCU

  • 6 PWM output

    • 3x for HS FETs

    • 3x for LS FETs

  • 1 PWM/DSHOT input

    • Any timer will do

  • 1 SPI

  • 3 ADCs for back EMF

  • 3 ADCs for current sense (FOC only)

Part Number

Price (each for order of 10)

Comments

Part Number

Price (each for order of 10)

Comments

STM32F302R8T7

8.75

72MHz max clock speed.. This was the initial selection for an MCU before we decided to make the primary firmware plan AM32

STM32F051R8T7

5.01

FINAL SELECTION. Compatible with both AM32 and STM32 Motor Control Workbench. Many COTS ESCs that use AM32 firmware use MCUs from the F0 series so it should be a safe selection.

AM32 has “hardware groups” which vary the pinout slightly. In theory I thin you can redefine the pins however you want which is what I was initially going to do to make things easier for layout. However, I decided that there’s no need to take that added risk and to just use one of their predefined pinouts so that FW bringup will be quicker. I have chosen HW Group A:

image-20241006-024153.png

ADC_IN

  • Phase VSENSE

    • A_VSENSE (ADC_IN5, PA5), Pin 21

    • B_VSENSE (ADC_IN4, PA4), Pin 20

    • C_VSENSE (ADC_IN0, PA0), Pin 14

  • Phase ISENSE

    • A_ISENSE (ADC_IN11, PC1), Pin 9

    • B_ISENSE (ADC_IN12, PC2), Pin 10

    • C_ISENSE (ADC_IN13, PC3), Pin 11

  • Bus VSENSE

    • BUS_VSENSE (ADC_IN1, PA1), Pin 15

Comms

  • SPI

    • SPI1_MOSI, Pin 57

    • SPI1_MISO, Pin 56

    • SPI1_SCK, Pin 55

    • SPI1_NSS, Pin 50

  • UART

    • UART_TX, Pin 58

    • UART_RX, Pin 59

  • DSHOT

    • DSHOT_IN (TIM15_CH1, PA2), Pin 16

    • TELEM_OUT (TIM15_CH2, PA3), Pin 17

PWM_OUT

  • HS FETs

    • INHA (TIM1_CH3, PA10), Pin 41

    • INHB (TIM1_CH2, PA9), Pin 42

    • INHC (TIM1_CH1, PA8), Pin 43

  • LS FETs

    • INLA (TIM1_CH3N, PB1), Pin 27

    • INLB (TIM1_CH2N), PB0), Pin 26

    • INLC (TIM1_CH1N, PA7), Pin 23

  • *TIM1 is being used as it provides this complementary channel feature (ex. CH1 and CH1N) which is designed for applications like driving half-bridges

MCU Fixed

  • Power & Clock

    • VBAT (Pin 1, Not used so DNP)

    • VDD (Pins 13, 32, 64)

    • VSS (Pins 12, 31, 63)

    • OSC-IN (Pin 5)

    • OSC-OUT (Pin 6)

    • OSC32-IN (Pin 3, Not used so DNP)

    • OSC32-OUT (Pin 4, Not used so DNP)

  • Programming

    • NRST (Pin 7)

    • BOOT0 (Pin 60)

    • SWDIO (Pin 46)

    • SWCLK (Pin 49)

GPIO

  • DRV Settings

    • DRV_EN (Pin 37, PC6)

    • DRV_CAL (Pin 38, PC7)

    • DRV_nFAULT (Pin 39, PC8)

  • Debug

    • IO Test LED #1 (Pin 28, PB2)

    • IO Test LED #2 (Pin 29, PB10)

    • IO Test LED #3 (Pin 30, PB11)