3-Shunt FOC (DRV8323RH) - AM13E232X Peripheral Configuration

This page documents how the AM13E232X peripherals are configured by SysConfig (3sh_sen_less_foc_drv8323rh_am13e232x.syscfg) for the LP-AM13E232X + BOOSTXL-DRV8323RH combination.

All values below are taken from that .syscfg file. Pin names are MCU pin names as assigned in SysConfig. If you change the .syscfg, this page must be updated to match.

The software handles that bind these SysConfig instances to the FOC library are set in system_config.c.

System-Level Signal Flow

digraph overview { graph [fontname="helvetica" rankdir=LR]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=cds style=filled fillcolor="#A0FFA0"]; PINS_I [label="Current sense pins\nPA30 / PB27 / PB28"] PINS_V [label="Voltage sense pins\nPA27 / PB30 / PA29 / PC7"] PINS_PWM [label="PWM pins\nPC10 - PC15"] PIN_NF [label="nFAULT\nPA26"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; ADC [label="ADC0 / ADC1 / ADC2"] PWM [label="MCPWM0\nUp-Down"] CMP [label="CMPSS0/1/2\nOC protection"] ECAP [label="ECAP\nIPD capture"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; XBAR [label="INPUTXBAR /\nPWMXBAR /\nOUTPUTXBAR"] PINS_I -> ADC PINS_V -> ADC PWM -> PINS_PWM PWM -> ADC [label="SOCA trigger" style=dashed] PINS_I -> CMP PIN_NF -> XBAR CMP -> XBAR XBAR -> PWM [label="TripZone"] XBAR -> ECAP }


1. MCPWM0 — Three-Phase PWM Generation

SysConfig instance: MTR1_MCPWM_BASE → peripheral MCPWM0

Parameter

Value

Counter mode

Up-Down (centre-aligned), DL_MCPWM_COUNTER_MODE_UP_DOWN

Time-base period

periodValue = 12500

Dead-band RED

25 time-base cycles

Dead-band FED

12 time-base cycles

FED polarity

Active-low

ADC SOC-A trigger

Counter up, CmpC (DL_MCPWM_SOC_TBCTR_U_CMPC)

Trip action

Force A and B low (DL_MCPWM_TZ_ACTION_LOW)

One-shot trip sources

OST1, OST2, OST3

Emulation mode

Free-run

The PWM frequency follows from the time-base clock and periodValue. The motor-control software also uses USER_M1_PWM_FREQ_kHz in user_mtr1.h / user_motor.h to compute its timing; keep the .syscfg period and that macro consistent.

PWM Pin Mapping

PWM Output

AM13E232X Pin

DRV8323RH Signal

MCPWM0 1A (Phase A High)

PC15

INHA

MCPWM0 1B (Phase A Low)

PC14

INLA

MCPWM0 2A (Phase B High)

PC11

INHB

MCPWM0 2B (Phase B Low)

PC10

INLB

MCPWM0 3A (Phase C High)

PC13

INHC

MCPWM0 3B (Phase C Low)

PC12

INLC


2. ADC — Current and Voltage Sensing

All three ADC instances are triggered by MCPWM0_SOCA (DL_ADC_TRIGGER_MCPWM0_SOCA) with a sample window of 19, so the phase currents and voltages are sampled at the PWM centre point.

Signal Name

ADC Instance

SOC

AM13E232X Pin

AIN Channel

Measurement

MTR1_IW_SEN

ADC_0

SOC0

PA30

AIN32

Phase W current

MTR1_VU_SEN

ADC_0

SOC1

PA27

AIN29

Phase U voltage

MTR1_IV_SEN

ADC_1

SOC0

PB27

AIN37

Phase V current

MTR1_VV_SEN

ADC_1

SOC1

PB30

AIN40

Phase V voltage

MTR1_IU_SEN

ADC_2

SOC0

PB28

AIN38

Phase U current

MTR1_VW_SEN

ADC_2

SOC1

PA29

AIN31

Phase W voltage

MTR1_VDC_SEN

ADC_2

SOC2

PC7

AIN19

DC bus voltage

  • ADC_0 does not set adcBase in the .syscfg (SysConfig default), ADC_1 is ADC1 and ADC_2 is ADC2.

  • ADC_0 INT1 is registered as the FOC interrupt, named motor1CtrlISR, with priority 0. The .syscfg sets enable = false for this interrupt, so it is not enabled by the SysConfig-generated initialization.

  • ADC_1 and ADC_2 each enable post-processing block PPB1.


3. CMPSS — Hardware Overcurrent Protection

Three CMPSS-Lite instances use the high comparator only. The negative input is the internal DAC (initial value 1800) and the positive input is the phase-current pin.

SysConfig Name

CMPSS Instance

Positive Input Pin

Phase Current

Filter

MTR1_CMPSS_U_BASE

CMPSS0 (default)

PB28

U (MTR1_IU_SEN)

prescale 1, window 8, threshold 8

MTR1_CMPSS_V_BASE

CMPSS1

PB27

V (MTR1_IV_SEN)

prescale 1, window 8, threshold 8

MTR1_CMPSS_W_BASE

CMPSS2

PA30

W (MTR1_IW_SEN)

prescale 1, window 8, threshold 8

  • Trip source is the filtered output (DL_CMPSSLITE_TRIP_FILTER), inverted.

  • Asynchronous output is enabled on all three high filters.

  • The low DAC of MTR1_CMPSS_W_BASE (CMPSS2) is routed to the pin as an analog output (lowDAC.enableDACOUT = true, PA4 / AIN10). This is used by the DAC plotting feature described in the Motor Parameter Tuning guide.


4. Crossbar (INPUTXBAR / PWMXBAR / OUTPUTXBAR)

Crossbar

SysConfig Name

Source

Destination

Purpose

INPUTXBAR1

MTR1_STOP_ACTION

Driven low (DL_XBAR_DRIVE_LOW)

MTR_STOP_INPUT (PWMXBAR, DL_XBAR_PWM_INPUTXBAR1)

Software motor stop

INPUTXBAR2

MTR1_nFAULT_TRIP

GPIO26_PA26 (nFAULT)

MTR1_GD_nFAULT_XBAR_INP (PWMXBAR, trip DL_XBAR_TRIP2)

Gate driver fault trip

PWMXBAR

MTR1_CMP_nFAULT_XBAR_INP

CMPSS0/1/2 CTRIPH, inverted

Trip DL_XBAR_TRIP3

Hardware overcurrent trip

OUTPUTXBAR5

IPD_ECAP_INPUT

DL_XBAR_OUT_CMPSS0_CTRIPOUTH

ECAP input and pin PA11

IPD pulse capture

Software mapping in system_config.c:

.pwmCfg.MotorStoptripInputXBARSource = DL_XBAR_INPUT1           /* INPUTXBAR1 */
.pwmCfg.MotorStopTZSource            = DL_MCPWM_TZ_SIGNAL_OST1
.pwmCfg.GateDriverFaultTZSource      = DL_MCPWM_TZ_SIGNAL_OST2
.pwmCfg.overCurrentTZSouce           = DL_MCPWM_TZ_SIGNAL_OST3

5. ECAP — IPD Pulse Capture

SysConfig instance: IPD_CAPTURE Software handle: halFOCConfig_M1.ecapIPDConfig.base = IPD_CAPTURE_BASE

Parameter

Value

Input source

DL_ECAP_INPUT_OUTPUTXBAR5

Reset counters

Enabled

Sync-out

Disabled (DL_ECAP_SYNC_OUT_DISABLED)

Capture event

DL_ECAP_EVENT_1


6. GPIO — Gate Driver Control and Diagnostics

SysConfig group: MTR1_GATE_DRIVER

GPIO Name

Pin

Direction

Notes

DRV8323RH Signal

GATE_EN_GPIO

PB31

Output

Initial value SET, pull-up

ENABLE

nFAULT_GPIO

PA26

Input

Standard-drive IO structure

nFAULT

GATE_MODE_GPIO

PB7

Output

Pull-down

MODE

GATE_GAIN_GPIO

PD5

Input

GAIN

GATE_CAL_GPIO

PC31

Output

CAL

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 (toggled in the FOC ISR)


7. UART — Serial Data Plot

SysConfig instance: SERIAL_DATA_PLOT → UC1

Parameter

Value

Baud rate

10 000 000 bps

Oversampling

8x

FIFO

Enabled

TX pin

PA0

RX pin

PA1

Used for high-speed streaming of motor variables to a serial plotter during development and tuning. See the Motor Parameter Tuning guide for the packet format.


8. System Clock

Parameter

Value

Clock profile

CONFIG_CLOCK_PROFILE_XTAL_SE_250

VREF source

Internal 3.3 V (DL_SYSCTL_VREF_INTERNAL_3_3_V)

Debug pins

PA13 (SWDIO), PA14 (SWCLK), PA15 (TDI), PA19 (SWO)

Crystal input

PC16 (X1)


Complete Pin Summary

AM13E232X Pin

Signal Name

Peripheral

Role

PA0

UART TX

UC1

Serial plot TX

PA1

UART RX

UC1

Serial plot RX

PA4

CMPSS2 DAC-L out

CMPSS2

DAC analog output

PA11

IPD_ECAP_INPUT

OUTPUTXBAR5

IPD async trip output

PA23

ISR_TIMING

GPIO

ISR timing toggle

PA26

nFAULT_GPIO / INPUTXBAR2

GPIO + XBAR

DRV8323RH nFAULT

PA27

MTR1_VU_SEN

ADC_0 SOC1

Phase U voltage

PA29

MTR1_VW_SEN

ADC_2 SOC1

Phase W voltage

PA30

MTR1_IW_SEN / CMPSS2 positive

ADC_0 SOC0 / CMPSS2

Phase W current + OC

PB6

FAULT_OUTPUT_GPIO

GPIO

Fault indicator

PB7

GATE_MODE_GPIO

GPIO

DRV8323RH MODE

PB27

MTR1_IV_SEN / CMPSS1 positive

ADC_1 SOC0 / CMPSS1

Phase V current + OC

PB28

MTR1_IU_SEN / CMPSS0 positive

ADC_2 SOC0 / CMPSS0

Phase U current + OC

PB30

MTR1_VV_SEN

ADC_1 SOC1

Phase V voltage

PB31

GATE_EN_GPIO

GPIO

DRV8323RH ENABLE

PC7

MTR1_VDC_SEN

ADC_2 SOC2

DC bus voltage

PC10

MCPWM0 2B

MCPWM0

Phase B Low

PC11

MCPWM0 2A

MCPWM0

Phase B High

PC12

MCPWM0 3B

MCPWM0

Phase C Low

PC13

MCPWM0 3A

MCPWM0

Phase C High

PC14

MCPWM0 1B

MCPWM0

Phase A Low

PC15

MCPWM0 1A

MCPWM0

Phase A High

PC31

GATE_CAL_GPIO

GPIO

DRV8323RH CAL

PD5

GATE_GAIN_GPIO

GPIO

DRV8323RH GAIN