1-Shunt FOC (DRV8329) - AM13E230X Peripheral Configuration

This page documents how the AM13E230X peripherals are configured by SysConfig (1sh_sen_less_foc_drv8329a.syscfg) for the LP-AM13E230X + DRV8329AEVM combination. The signal routing is captured in the generated .dot diagram 1sh_sen_less_foc_drv8329a_am13e230x_lp_m33_nortos_ti_arm_clang.dot.

The single-shunt topology uses two MCPWM instances: MCPWM4 generates the three-phase motor PWM, while MCPWM0 (MTR1_SINGLE_SH_TRIG) acts as a dedicated timing peripheral that generates four precisely-timed ADC triggers per PWM cycle to reconstruct the three-phase currents from a single DC-link shunt measurement.

External Connections (Boosterpack Connector)

The table below maps motor-control signals to AM13E230X LaunchPad header pins for the LP-AM13E230X + DRV8329AEVM combination.

Signal

LaunchPad Pin

Description

PWM_AH

PB3

Phase A high-side PWM

PWM_AL

PA7

Phase A low-side PWM

PWM_BH

PB1

Phase B high-side PWM

PWM_BL

PA2

Phase B low-side PWM

PWM_CH

PB2

Phase C high-side PWM

PWM_CL

PA25

Phase C low-side PWM

ADC_IDC

PA30

DC-link current sense (single shunt)

ADC_VDC

PA17

DC bus voltage sense

ADC_VU

PA16

Phase U voltage sense

ADC_VV

PA18

Phase V voltage sense

ADC_VW

PA28

Phase W voltage sense

nFAULT

PA11

Gate driver fault input

GATE_N_SLEEP

PA3

Gate driver sleep/enable output

DRV_OFF

PB18

Gate driver OFF control

IPD_OUT

PA22

IPD async trip output

DEBUG_TRIG

PA20

Debug trigger output

System-Level Signal Flow

The diagram below shows the complete signal routing from physical pins through the crossbar infrastructure to the PWM, ADC, CMPSS, and GPIO peripherals.

digraph overview { graph [fontname="helvetica" rankdir=LR]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; /* Physical pins */ node [shape=cds style=filled fillcolor="#A0FFA0"]; PA30 [label="PA30\n(IDC / CMPSS_IDC)"] PA17 [label="PA17\n(VDC)"] PA16 [label="PA16\n(VU)"] PA18 [label="PA18\n(VV)"] PA28 [label="PA28\n(VW)"] PB3 [label="PB3\n(PWM1A/PhA_H)"] PA7 [label="PA7\n(PWM1B/PhA_L)"] PB1 [label="PB1\n(PWM2A/PhB_H)"] PA2 [label="PA2\n(PWM2B/PhB_L)"] PB2 [label="PB2\n(PWM3A/PhC_H)"] PA25 [label="PA25\n(PWM3B/PhC_L)"] PA11 [label="PA11\n(nFAULT)"] PA22 [label="PA22\n(IPD_OUT)"] PA20 [label="PA20\n(Debug_Trigger)"] /* Peripheral blocks */ node [shape=rectangle style=filled fillcolor="#A0A0FF"]; ADC2 [label="ADC2\nIDC×4 + VW"] ADC1 [label="ADC1\nVV"] ADC0 [label="ADC0\nVDC + VU"] PWM4 [label="MCPWM4\n10 kHz\nUp-Down"] PWM0 [label="MCPWM0\nSingle-Shunt\nTrigger Timer"] CMPSS [label="CMPSS2\nIDC OC Protection"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; XBAR [label="INPUTXBAR/\nPWMXBAR/\nOUTPUTXBAR"] PA30 -> ADC2 [label="IDC×4 SOCs"] PA28 -> ADC2 [label="VW SOC4"] PA18 -> ADC1 PA17 -> ADC0; PA16 -> ADC0 PWM4 -> PB3; PWM4 -> PA7 PWM4 -> PB1; PWM4 -> PA2 PWM4 -> PB2; PWM4 -> PA25 PWM4 -> PWM0 [label="SYNCOUT" style=dashed] PWM0 -> ADC2 [label="SOCA/B/C/D\n4 triggers" style=dashed] PWM0 -> ADC1 [label="SOCA trigger" style=dashed] PWM4 -> ADC0 [label="SOCA trigger\n(TBCTR=ZERO)" style=dashed] PA30 -> CMPSS PA11 -> XBAR [label="nFAULT"] CMPSS -> XBAR XBAR -> PWM4 [label="TripZone"] XBAR -> PA22 [label="IPD output"] XBAR -> PA20 [label="Debug trigger"] }


1. MCPWM4 — Three-Phase PWM Generation

SysConfig instance: MTR1_MCPWM_BASE → peripheral MCPWM4

Parameter

Value

Source

Counter mode

Up-Down (centre-aligned)

DL_MCPWM_COUNTER_MODE_UP_DOWN

PWM frequency

10 kHz

periodValue = 10000, TB clock 200 MHz

Dead-band RED

20 TB cycles (100 ns)

deadBand.delayRED = 20

Dead-band FED

10 TB cycles (50 ns)

deadBand.delayFED = 10

FED polarity

Active-low (inverted)

DL_MCPWM_DB_POLARITY_ACTIVE_LOW

ADC SOC-A trigger

Counter at ZERO

DL_MCPWM_SOC_TBCTR_ZERO

SYNCOUT

At TBCTR=ZERO → feeds MCPWM0

syncOut

Trip action

Force A and B LOW

DL_MCPWM_TZ_ACTION_LOW

One-shot trip sources

OST1 (stop), OST2 (nFAULT), OST3 (OC)

oneShotSource

Emulation mode

Free-run

DL_MCPWM_EMULATION_FREE_RUN

Note

Unlike the 3-shunt solution where PWM4_SOCA fires at TBCTR=U_CMPC (mid-cycle), the 1-shunt solution fires PWM4_SOCA at TBCTR=ZERO. This triggers ADC0 for voltage sensing only. The four DC-link current samples are triggered by MCPWM0 at precisely computed compare points around the active switching vectors.

PWM Pin Mapping — LaunchPad Header

digraph pwm_pins { graph [fontname="helvetica" rankdir=LR label="MCPWM4 → LaunchPad Pins"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=rectangle style=filled fillcolor="#FFFFA0"]; PWM4_AQ_1A [label="PWM4_AQ_1A\n(Zero:LOW Period:HIGH\nCntUp_CmpA:HIGH CntDn_CmpB:LOW)"] PWM4_AQ_2A [label="PWM4_AQ_2A\n(Zero:LOW Period:HIGH\nCntUp_CmpA:HIGH CntDn_CmpB:LOW)"] PWM4_AQ_3A [label="PWM4_AQ_3A\n(Zero:LOW Period:HIGH\nCntUp_CmpA:HIGH CntDn_CmpB:LOW)"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; DB1A [label="PWM4_DB_1A"]; DB1B [label="PWM4_DB_1B\n(FED, Inverted)"] DB2A [label="PWM4_DB_2A"]; DB2B [label="PWM4_DB_2B\n(FED, Inverted)"] DB3A [label="PWM4_DB_3A"]; DB3B [label="PWM4_DB_3B\n(FED, Inverted)"] TZ [label="PWM4_TripZone"] node [shape=cds style=filled fillcolor="#A0FFA0"]; PB3 [label="PB3\nPhase A High"]; PA7 [label="PA7\nPhase A Low"] PB1 [label="PB1\nPhase B High"]; PA2 [label="PA2\nPhase B Low"] PB2 [label="PB2\nPhase C High"]; PA25[label="PA25\nPhase C Low"] PWM4_AQ_1A -> DB1A [label="RED"]; DB1A -> PB3 [label="TripLogic"] PWM4_AQ_1A -> DB1B [label="FED"]; DB1B -> PA7 [label="TripLogic"] PWM4_AQ_2A -> DB2A [label="RED"]; DB2A -> PB1 [label="TripLogic"] PWM4_AQ_2A -> DB2B [label="FED"]; DB2B -> PA2 [label="TripLogic"] PWM4_AQ_3A -> DB3A [label="RED"]; DB3A -> PB2 [label="TripLogic"] PWM4_AQ_3A -> DB3B [label="FED"]; DB3B -> PA25[label="TripLogic"] TZ -> DB1A; TZ -> DB1B; TZ -> DB2A; TZ -> DB2B; TZ -> DB3A; TZ -> DB3B }

PWM Output

AM13E230X Pin

DRV8329 Signal

PWM4_1A (Phase A High)

PB3

INHA

PWM4_1B (Phase A Low)

PA7

INLA

PWM4_2A (Phase B High)

PB1

INHB

PWM4_2B (Phase B Low)

PA2

INLB

PWM4_3A (Phase C High)

PB2

INHC

PWM4_3B (Phase C Low)

PA25

INLC


2. MCPWM0 — Single-Shunt ADC Trigger Timer

SysConfig instance: MTR1_SINGLE_SH_TRIG → peripheral MCPWM0

This is the key differentiator of the single-shunt topology. MCPWM0 has no PWM output pins — it operates purely as a timing peripheral. It is synchronised from MCPWM4_SYNCOUT (at TBCTR=ZERO) and generates four ADC start-of-conversion triggers at compare points computed by the FOC algorithm to sample the DC-link current during the two active switching vectors of each PWM half-cycle.

digraph pwm0_timing { graph [fontname="helvetica" rankdir=LR label="MCPWM0 Single-Shunt Trigger Timing"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=rectangle style=filled fillcolor="#A0A0FF"]; PWM4Z [label="MCPWM4\nSYNCOUT\n(TBCTR=ZERO)"] PWM0 [label="MCPWM0\nUp-Down\n(synced from PWM4)"] CMP1A [label="CMP1A\n(U_CMP1A)\nSample window 1"] CMP2A [label="CMP2A\n(U_CMP2A)\nSample window 2"] CMPC [label="CMPC\n(D_CMPC)\nSample window 3"] CMPD [label="CMPD\n(D_CMPD)\nSample window 4"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; SOCA [label="PWM0_SOCA\n→ ADC2_SOC0\n(IDC sample 1)"] SOCB [label="PWM0_SOCB\n→ ADC2_SOC1\n(IDC sample 2)"] SOCC [label="PWM0_SOCC\n→ ADC2_SOC2\n(IDC sample 3)"] SOCD [label="PWM0_SOCD\n→ ADC2_SOC3\n(IDC sample 4)\n+ ADC2_SOC4 (VW)\n+ ADC1_SOC0 (VV)"] PWM4Z -> PWM0 [label="SYNCIN"] PWM0 -> CMP1A; PWM0 -> CMP2A; PWM0 -> CMPC; PWM0 -> CMPD CMP1A -> SOCA; CMP2A -> SOCB; CMPC -> SOCC; CMPD -> SOCD }

Parameter

Value

Description

Counter mode

Up-Down (centre-aligned)

Matches MCPWM4

Period

Same as MCPWM4 (10000)

Synchronised operation

Sync source

MCPWM4_SYNCOUT (TBCTR=ZERO)

Phase-locked to motor PWM

SOCA trigger

Counter up, CMP1A (U_CMP1A)

DC-link current sample 1

SOCB trigger

Counter up, CMP2A (U_CMP2A)

DC-link current sample 2

SOCC trigger

Counter down, CMPC (D_CMPC)

DC-link current sample 3

SOCD trigger

Counter down, CMPD (D_CMPD)

DC-link current sample 4 + VW + VV

Output pins

None

Timing only, no GPIO routing

The four compare values (U_CMP1A, U_CMP2A, D_CMPC, D_CMPD) are updated each PWM cycle by the FOC algorithm based on the current duty cycle to ensure sampling occurs during the active vector intervals when the DC-link current equals a phase current.



4. CMPSS2 — Hardware Overcurrent Protection

SysConfig instance: MTR1_CMPSS_IDC → peripheral CMPSS2

A single CMPSS-Lite instance monitors the DC-link current on PA30. The DAC threshold is set to 1800 counts (≈ 1.46 V on a 3.3 V reference), corresponding to the maximum allowable DC-link current.

digraph cmpss { graph [fontname="helvetica" rankdir=LR label="CMPSS2 DC-Link Overcurrent Protection Path"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=cds style=filled fillcolor="#A0FFA0"]; PA30c [label="PA30\nIDC (P input)"] PA4o [label="PA4\nCMPSS2_DACL_OUT\n(analog monitor)"] node [shape=triangle style=filled orientation=-90 fillcolor="#A0A0FF"]; CMP2 [label="CMPSS2\nMTR1_CMPSS_IDC"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; DAC2 [label="DAC_H=1800\n(N input)"] CTRIPH [label="CMPSS2_CTRIPH\n(FILTER, no invert)"] CTRIPOUTH[label="CMPSS2_CTRIPOUTH\n(ASYNC, no invert)"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; PWMXBAR3 [label="PWMXBAR3\nMTR1_CMP_nFAULT\n(Invert)"] OUTXBAR5 [label="OUTPUTXBAR5\nIPD_ECAP_INPUT"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; TZ3 [label="TZ3 → MCPWM4\nOne-shot trip"] node [shape=cds style=filled fillcolor="#A0FFA0"]; PA22o [label="PA22\nIPD output"] PA30c -> CMP2; DAC2 -> CMP2 CMP2 -> CTRIPH; CMP2 -> CTRIPOUTH CTRIPH -> PWMXBAR3 PWMXBAR3 -> TZ3 CTRIPOUTH -> OUTXBAR5 OUTXBAR5 -> PA22o CMP2 -> PA4o [label="DAC-L analog out" style=dashed] }

Parameter

Value

Description

CMPSS instance

CMPSS2

MTR1_CMPSS_IDC

P-input pin

PA30

DC-link current sense

N-input

Internal DAC-H

Programmable threshold

DAC-H value

1800 counts

≈ 1.46 V overcurrent threshold

CTRIPH invert

No invert

Active-high trip (differs from 3-shunt)

Filter window

8 samples, prescale=1

Digital debounce

Filtered path

CTRIPH → PWMXBAR3 (inverted) → TZ3

PWM one-shot trip

Async path

CTRIPOUTH → OUTPUTXBAR5 → PA22

IPD pulse output

DAC-L output

PA4 (analog)

Current monitor / debug

Two trip paths:

  • Filtered path (CTRIPH → PWMXBAR3 → TZ3): debounced by the 8-sample digital filter, inverted in PWMXBAR3, routed to PWM one-shot trip zone 3 to disable all PWM outputs on overcurrent.

  • Async path (CTRIPOUTH → OUTPUTXBAR5 → PA22): unfiltered async output used as the IPD (Initial Position Detection) pulse output pin.

Note

Unlike the 3-shunt solution which inverts CTRIPH inside the CMPSS block, the 1-shunt solution uses no inversion on CTRIPH — the inversion is applied in PWMXBAR3 instead.


5. Crossbar (INPUTXBAR / PWMXBAR / OUTPUTXBAR)

The crossbar infrastructure routes fault signals to the PWM trip zone and provides the IPD output and debug trigger signals.

digraph xbar { graph [fontname="helvetica" rankdir=LR label="Crossbar Signal Routing"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=cds style=filled fillcolor="#A0FFA0"]; LOW [label="LOW\n(tied low)"] PA11x [label="PA11\nnFAULT"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; IX1 [label="INPUTXBAR1\nMTR1_STOP_ACTION\n(Drive LOW)"] IX2 [label="INPUTXBAR2\nMTR1_nFAULT_TRIP\n(GPIO/PA11)"] PX1 [label="PWMXBAR1\nMTR_STOP_INPUT"] PX2 [label="PWMXBAR2\nMTR1_GD_nFAULT"] PX3 [label="PWMXBAR3\nMTR1_CMP_nFAULT\n(Invert)"] OX5 [label="OUTPUTXBAR5\nIPD_ECAP_INPUT"] OX3 [label="OUTPUTXBAR3\nDebug_Trigger\n(ADC2_EVT1)"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; TZ1 [label="TZ1\n(Motor Stop)"]; TZ2 [label="TZ2\n(GD nFAULT)"] TZ3 [label="TZ3\n(OC Trip)"] node [shape=cds style=filled fillcolor="#A0FFA0"]; PA22x [label="PA22\nIPD output"] PA20x [label="PA20\nDebug trigger"] LOW -> IX1 -> PX1 -> TZ1 PA11x -> IX2 -> PX2 -> TZ2 PX3 -> TZ3 OX5 -> PA22x OX3 -> PA20x }

Crossbar

SysConfig Name

Source

Destination

Purpose

INPUTXBAR1

MTR1_STOP_ACTION

Tied LOW

PWMXBAR1 → TZ1

Software motor stop

INPUTXBAR2

MTR1_nFAULT_TRIP

PA11 (nFAULT GPIO)

PWMXBAR2 → TZ2

Gate driver fault trip

PWMXBAR3

MTR1_CMP_nFAULT_XBAR_INP

CMPSS2 CTRIPH (inverted)

TZ3

Hardware OC trip

OUTPUTXBAR5

IPD_ECAP_INPUT

CMPSS2 CTRIPOUTH

PA22

IPD pulse output

OUTPUTXBAR3

Debug_Trigger

ADC2_EVT1

PA20

ADC debug trigger output

Note

The 1-shunt solution routes nFAULT from PA11 (not PB4 as in the 3-shunt solution). OUTPUTXBAR5 drives PA22 for the IPD output (not PA11). A new OUTPUTXBAR3 (Debug_Trigger) routes ADC2_EVT1 to PA20 for oscilloscope debugging of the ADC trigger timing.


6. GPIO — Gate Driver Control

SysConfig group: MTR1_GATE_DRIVER

GPIO Name

Pin

Direction

Initial State

DRV8329 Signal

GATE_N_SLEEP

PA3

Output

HIGH (active)

nSLEEP

nFAULT_GPIO

PA11

Input

—

nFAULT

DRV_OFF

PB18

Output

LOW

OFF

SysConfig group: MTR1_FOC_CTRL

GPIO Name

Pin

Direction

Purpose

FAULT_OUTPUT_GPIO

PB6

Output

Fault indicator output

ISR_TIMING

PA23

Output

ISR timing measurement (toggle in ISR)

Note

The DRV8329 uses nSLEEP (active-low sleep) instead of the DRV8323’s ENABLE pin. DRV_OFF is an additional control pin unique to the DRV8329 that disables the gate driver outputs without entering sleep mode.


7. UART — Serial Data Plot

SysConfig instance: SERIAL_DATA_PLOT → UC1

Parameter

Value

Baud rate

4 000 000 bps

Direction

TX only

FIFO

Enabled, RX threshold = FULL

TX pin

PA0

Used for high-speed streaming of motor variables (currents, speed, angle) to a serial plotter during development and tuning.


8. System Clock

Parameter

Value

VREF source

Internal 3.3 V

HFCLK

Enabled

SYSPLL reference

HFCLK

SYSPLL Q-divider

32

Resulting TB clock

200 MHz (PWM time-base)


Complete Pin Summary

AM13E230X Pin

AIN / Function

Signal Name

Peripheral

Role

PA0

—

UART TX

UC1

Serial plot TX

PA2

—

PWM4_2B

MCPWM4

Phase B Low

PA3

—

GATE_N_SLEEP

GPIO

DRV8329 nSLEEP

PA4

AIN10

CMPSS2_DACL_OUT

CMPSS2

DAC analog monitor output

PA7

—

PWM4_1B

MCPWM4

Phase A Low

PA11

—

nFAULT_GPIO / INPUTXBAR2

GPIO + XBAR

DRV8329 nFAULT

PA16

AIN16

MTR1_VU_SEN

ADC0 SOC1

Phase U voltage

PA17

AIN17

MTR1_VDC_SEN

ADC0 SOC0

DC bus voltage

PA18

AIN18

MTR1_VV_SEN

ADC1 SOC0

Phase V voltage

PA20

—

Debug_Trigger

OUTPUTXBAR3

ADC2 event debug output

PA22

—

IPD_OUT

OUTPUTXBAR5

IPD async trip output

PA23

—

ISR_TIMING

GPIO

ISR timing toggle

PA25

—

PWM4_3B

MCPWM4

Phase C Low

PA28

AIN30

MTR1_VW_SEN

ADC2 SOC4

Phase W voltage

PA30

AIN32

MTR1_IDC_SEN / CMPSS2_P

ADC2 SOC0-3 / CMPSS2

DC-link current (×4) + OC

PB1

—

PWM4_2A

MCPWM4

Phase B High

PB2

—

PWM4_3A

MCPWM4

Phase C High

PB3

—

PWM4_1A

MCPWM4

Phase A High

PB6

—

FAULT_OUTPUT

GPIO

Fault indicator

PB18

—

DRV_OFF

GPIO

DRV8329 OFF control