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
01
Sample current
On-die SAR ADC, fired by the PWM at the ripple null
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
Block
Limit
Note
UART × 2
115,200 baud, 8N1
Writes wait while busy; a byte is never dropped
SPI master
Up to 25 MHz
0.64 µs per 16-bit word
I²C master
100 / 400 kHz, 7-bit
Clock stretching; a 2-byte read takes ~72 µs at 400 kHz
3-phase PWM
Dead-time up to 5.1 µs
Hardware brake forces all six outputs off in ≤ 2 cycles