Connect Microcontroller

Steps for connecting a 32-bit microcontroller (such as Teensy, Raspberry PICO, Arduino Due, or ESP32) to the BLDC driver board

Connecting Pins

Not all driver boards have current sensors

Motor driverMCU

GND

external power source (-)

VDD

external power source (+)

EN

digital pin

IN1, IN2, IN3

PWM enabled digital pins

C1, C2

analog (ADC) pins

EncoderMCU

V3.3

3.3 volt output

GND

ground pin

CS (select)

CS/SS pin (Teensy 3.2: PIN10)

SCK (clock)

SCK/SCLK/CLK pin (Teensy 3.2: PIN13)

MISO (master input, slave output)

MISO/SDI/DI/DIN pin (Teensy 3.2: PIN12)

MOSI (master output, slave input)

MOSI/SDO/DO/DOUT (Teensy 3.2: PIN11)

Initialize Driver Board Pins

Update the initialization at the start of the library to match the pin numbers of the MCU.

/* CS pin of the encoder */
#define CS_MAGNETIC_SENSOR_PIN    10

/* BLDCMotor (int pole-pairs): GB36-2 has 7 pole-pairs */
BLDCMotor _bldc = BLDCMotor(7);

/* BLDCDriver3PWM(IN1, IN2, IN3, EN) */
BLDCDriver3PWM _driver = BLDCDriver3PWM(21, 22, 23, 20);

Last updated