Deepgrid Semi
DG32 · LOCKSTEP RISC-V MOTOR-CONTROL SILICONFIRST SILICON · SEP 2026
Discuss your application

The CPU runs two regulators, not the loop

Each field-oriented-control tick samples current, transforms it, regulates it and updates the bridge. DG32 moves every expensive step into hardware, so the loop cost is fixed and known.

One control tick, stage by stage

  1. 01

    Sample current

    On-die SAR ADC, fired by the PWM at the ripple null

    177 cycles
  2. 02

    Clarke / Park

    CORDIC sin/cos and rotation

    53–58 cycles per op
  3. 03

    PI regulators

    Two regulators in plain C on the CPU

    ~8 cycles per instruction
  4. 04

    Inverse Park

    CORDIC rotation

    53–58 cycles per op
  5. 05

    Update PWM

    Shadow registers load at the next period boundary

    next reload
  6. 06

    Check for faults

    Lockstep comparator, continuously

    39-cycle inject-to-latch
20 KHZ ELECTRICAL CYCLE · 50 µS PERIOD

Hardware Coordinate Rotation & PWM Waveform

02 · CORDIC CLARKE & PARK TRANSFORMCYCLE 0700 / 2500θ = 101°
Ia (Phase U)Ib (Phase V)Ic (Phase W)SVPWM Gate Train

Scrub by scrolling or dragging across the canvas. At 50 MHz, 2500 clock cycles equal exactly one 50 µs loop tick.

Cycle costs measured in simulation at the 50 MHz clock, where one cycle is 20 ns.

WHY THE LOOP RUNS IN HARDWARE

The core fetches every instruction,
so the peripherals do the maths.

The core fetches every instruction over the bus. That one measured constant is what the whole peripheral set is designed around.

~8CLOCK CYCLES PER INSTRUCTION

Every instruction is fetched over the bus; there is no instruction cache.

54 vs ~6CYCLES FOR AN INT8 MULTIPLY-ACCUMULATE

Measured in plain C on this core, against a core with an instruction cache.

~1.9 µsOF A ~5 µS LOOP FOR AN SPI ADC READ

Why the converter moved on-die: it was the largest single cost.

~5 + ~5 µsACQUISITION + COMPUTE

The full sensor-to-PWM loop in simulation: about a 100 kHz closed loop.

Why sample at the PWM centre

Centre-aligned PWM makes the switching edges symmetric, so the middle of each period sits at the current-ripple null.

WHYSampling there reads true phase current without the delay of an analog filter. That is why the sample trigger comes from the PWM block, not a timer.

The loop is not carrier-limited

A ~25 kHz carrier was measured as 100 sample triggers in 4 ms, and the ADC clock is sized for loops up to ~100 kHz.

WHYThe carrier and the converter both have headroom; the budget below, not the peripherals, sets the practical loop rate.

The first lever for more CPU maths

An instruction cache or fetch buffer.

WHYThe fetch-bound core is the one constant the peripheral set is designed around. If firmware ever needs more maths than two regulators and an observer, that is where the cycles come from.

Safety runs alongside, not after

The lockstep comparator checks every committed store continuously, at no cost to the loop budget.

WHYSoftware self-test runs periodically and cannot see a fault between runs; the comparator sees it on the store it happens.

LOOP TIMING & BUDGET

About 300 cycles are hardware,
whatever the loop rate.

One ADC sample, two CORDIC operations and a PWM write cost about 300 cycles at any loop rate. Pick a rate to see what is left for the regulators and observers.

2,500CYCLES PER PERIOD
~300HARDWARE, FIXED
~2,200CPU BUDGET
~275CPU INSTRUCTIONS*
Hardware · 12%CPU budget · 88%

WHAT FITS AT 20 KHZFOC with field-weakening and a state observer

*Derived: CPU budget ÷ ~8 cycles per instruction, the measured cost of this fetch-bound core.

PERIPHERAL LIMITS & CAPABILITIES

What firmware can count on,
block by block.

Capability and timing per block, from the datasheet’s block notes. Design and simulated values, pending silicon.

Peripheral limits
BlockLimitNote
UART × 2115,200 baud, 8N1Writes wait while busy; a byte is never dropped
SPI masterUp to 25 MHz0.64 µs per 16-bit word
I²C master100 / 400 kHz, 7-bitClock stretching; a 2-byte read takes ~72 µs at 400 kHz
3-phase PWMDead-time up to 5.1 µsHardware brake forces all six outputs off in ≤ 2 cycles
DShot × 416-bit frames with CRCAll four channels share one bit-time counter
Encoder + Hall4× quadrature, index, 3 HallEdge timestamps for low-speed velocity
SAR ADC8-bit differential, ~200 kSa/sFired by the PWM sample trigger
CORDIC20 iterations53–58 cycles per operation, fixed
DMABlock moves~7.1 cycles per word

WHAT THE FIGURES ON THIS PAGE REST ON

Evidence behind the control-loop figures
FigureEvidenceSource
~100 kHzSimulatedDG32-LITE Architecture Guide
~300 cyclesSimulatedDG32-LITE Architecture Guide
177 cyclesSimulatedDG32-LITE Architecture Guide
53 to 58 cyclesSimulatedDG32-LITE Architecture Guide
~8 cycles per instructionSimulatedDG32-LITE Architecture Guide
55 to 62 MHzPost-routeDeepGrid Datasheets Engineering Specification
82%AnalyticDG32 AI Architecture