Post · 5 min read· pp. 192–196

Silabs Hardware-Specific Examples for SimpleFOC

On this page

This documentation describes hardware-specific example projects for running the SimpleFOC library on Silicon Labs EFR32 microcontrollers (tested on Arduino Nano Matter). Each example demonstrates a motor control use case using a 6PWM BLDC driver.

Example List

  • efr32_hall_sensor_velocity_6pwm
    • Demonstrates velocity control of a BLDC motor using a Hall sensor for feedback and a 6PWM driver on an EFR32 board.
  • efr32_open_loop_velocity_6pwm
    • Shows how to run a BLDC motor in open-loop velocity mode (no sensor feedback) using a 6PWM driver on EFR32.
  • efr32_torque_velocity_6pwm
    • Example of torque and velocity control for a BLDC motor using a 6PWM driver on EFR32, suitable for advanced control scenarios.

Motor control with BLE example

This example is available on the SiliconLabsSoftware GitHub repository.

Hardware Setup

Required hardware:

A dedicated interface board set-up connecting the Motor - Power Stage - Nano Matter. Jump wires can be used as well to connect the boards.

Connect the Arduino Nano Matter board to the DRV8305EVM according to the board pin mapping (phase outputs, PWM inputs, and Hall sensor connections).

Wiring Table: Arduino Nano Matter to BOOSTXL-DRV8305 & BLDC Motor

This table describes the connections between the Arduino Nano Matter, the TI BOOSTXL-DRV8305 driver board, and a 3-phase BLDC motor with Hall sensors.

From (Nano Matter Pin)To (DRV8305 BoosterPack Pin)BLDC MOTORFunction / Description
3.3V3V3HALL/ENC Supply*3.3V Power the BoosterPack provides 3.3V through an LDO
GNDPowerSupply GNDHALL/ENC sensor GNDCommon Ground
N/APowerSupply 12VN/APower supply for power stage 4.4 to 45 V, consider motor power
A0ISENAN/APhase A current sense
A1ISENBN/APhase B current sense
A2ISENCN/APhase C current sense
A3VSENAN/APhase A Voltage sense (Optional, not mandatory to run examples)
A4VSENBN/APhase B Voltage sense (Optional, not mandatory to run examples)
A5VSENCN/APhase C Voltage sense (Optional, not mandatory to run examples)
A6VSENVPVDDN/ADC BUS Voltage sense (Optional, not mandatory to run examples)
D0 (MOSI1)SDIN/ADRV8035 SPI connection, configuration and status reading (Optional, not mandatory to run examples)
D1 (MISO1)SDON/ADRV8035 SPI connection, configuration and status reading (Optional, not mandatory to run examples)
D2 (SCK1)SCLKN/ADRV8035 SPI clock, configuration and status reading (Optional, not mandatory to run examples)
D3 (SS1)SCSN/ADRV8035 SPI chip select, configuration and status reading (Optional, not mandatory to run examples)
D4N/AHALL A or Encoder AMotor sensor connection (Hall configuration in examples)
D5N/AHALL B or Encoder BMotor sensor connection (Hall configuration in examples)
D6PWMHAN/APWM Phase A High-Side Gate Signal
D7PWMLAN/APWM Phase A Low-Side Gate Signal
D8PWMHBN/APWM Phase B High-Side Gate Signal
D9PWMLBN/APWM Phase B Low-Side Gate Signal
D10PWMHCN/APWM Phase C High-Side Gate Signal
D11PWMLCN/APWM Phase C Low-Side Gate Signal
D12ENGATEN/AEnable DRV8305 gate driver
D13N/AHALL C or Encoder IndexMotor sensor connection (Hall configuration in examples)
N/APHASE UPHASE UMotor phase connection
N/APHASE VPHASE VMotor phase connection
N/APHASE WPHASE WMotor phase connection

Important Notes:

  • Power: Ensure the DRV8305’s PVDD and GVDD jumpers are correctly set for your motor’s voltage. The power supply should be rated at least twice the motor’s nominal power. The BoosterPack can supply the Nano Matter if it is not connected to USB.
  • Rotor sensor: Some Encoder or Hall sensors might require 5V supply, make sure of proper level shifting if required.
  • SPI: The SPI connection (nSCS, SPI_CLK, SPI_MOSI, SPI_MISO) is used to configure the DRV8305 driver IC (e.g., set gain, fault parameters). It is optional for the examples. The examples are using the default gate driver configuration. Only needed if you wish to change the default gate driver configuration (e.g., dead time, fault parameters).

Software Setup

  1. Arduino IDE

  2. Silicon Labs Arduino Core

    • Open Boards Manager in Arduino IDE.

    • Search for Silicon Labs and install the latest version (2.3.0 or newer).

    • If not found, add this URL under Preferences → Additional Boards Manager URLs:

      text

https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json

code
3. **SimpleFOC (Silabs-modified version)**

   - Open *Library Manager* in Arduino IDE.
   - Search and add *Simple FOC* library
4. **(Optional) SimpleFOC Studio or web viewer**

   - For runtime tuning and monitoring.
   - [Docs](/u/c85310e31581a546)
   - [Enable Monitoring](/u/f45cfaefddeef173)

---

## Running the Examples

1. Open the `.ino` file in Arduino IDE.
2. Select your **Arduino Nano Matter** board.
3. Compile & upload.
4. Open the Serial Monitor (115200 baud)
5. (Optional) Connect with monitoring tools.
   1. Modification of the example code is necessary to enable monitoring feature.
   2. [Enable Monitoring](/u/f45cfaefddeef173)

### Example Commands

Send commands to control the motor:

```bash
M50    # Run clockwise at 50 rad/s
M-50   # Run counter-clockwise at 50 rad/s
M0     # Stop motor

Notes on EFR32 Porting

The EFR32 port of SimpleFOC includes:

  • Full 6PWM driver support (deadtime insertion, duty cycle updates).
  • Current sense integration (low-side sensing tested).
  • Arduino-style pin mapping for portability.

References


Copyright © 2026. Distributed by an MIT license.