3-Shunt Hall Sensored FOC (DRV8323RH) - AM13E230X Peripheral Configuration

This page documents how the AM13E230X peripherals are configured by SysConfig (3sh_hall_sen_foc_drv8323rh.syscfg) for the LP-AM13E230X + BOOSTXL-DRV8323RH combination with Hall sensor feedback.

The three-shunt Hall sensored topology shares the same current sensing and PWM architecture as the sensorless three-shunt solution. The key addition is the Hall sensor interface: three GPIO inputs (Hall A, Hall B, Hall C) routed through the InputXBAR to ECAP1, which captures Hall edge timing for speed measurement. The FOC angle is derived from the Hall sector lookup table rather than a software observer.

External Connections (Boosterpack Connector)

The table below maps motor-control signals to AM13E230X LaunchPad header pins for the LP-AM13E230X + BOOSTXL-DRV8323RH 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_IU

PA30

Phase U current sense (three-shunt)

ADC_IV

PA27

Phase V current sense (three-shunt)

ADC_IW

PA17

Phase W current sense (three-shunt)

ADC_VDC

PA26

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

PB4

Gate driver fault input

GATE_EN

PA3

Gate driver enable output

GATE_MODE

PB7

Gate driver mode select

GATE_CAL

PB11

Gate driver calibration

GATE_GAIN

PB12

Gate driver gain select

IPD_OUT

PA11

IPD async trip output

Hall A

PB8

Hall sensor phase A input

Hall B

PB9

Hall sensor phase B input

Hall C

PA8

Hall sensor phase C input

System-Level Signal Flow

The diagram below shows the complete signal routing from physical pins through the crossbar infrastructure to the PWM, ADC, CMPSS, ECAP, and Hall sensor 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(IU / CMPSS_U)"] PA27 [label="PA27\n(IV / CMPSS_V)"] PA17 [label="PA17\n(IW / CMPSS_W)"] PA16 [label="PA16\n(VU)"] PA18 [label="PA18\n(VV)"] PA28 [label="PA28\n(VW)"] PA26 [label="PA26\n(VDC)"] 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)"] PB4 [label="PB4\n(nFAULT)"] PA11 [label="PA11\n(IPD_OUT)"] PB8 [label="PB8\n(Hall A)"] PB9 [label="PB9\n(Hall B)"] PA8 [label="PA8\n(Hall C)"] /* Peripheral blocks */ node [shape=rectangle style=filled fillcolor="#A0A0FF"]; ADC2 [label="ADC2\nIU/VW/VDC"] ADC1 [label="ADC1\nIV/VV"] ADC0 [label="ADC0\nIW/VU"] PWM4 [label="MCPWM4\n10 kHz\nUp-Down"] CMPSS [label="CMPSS0/1/2\nOC Protection"] ECAP0 [label="ECAP0\nIPD Capture"] ECAP1 [label="ECAP1\nHall Speed Cap"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; XBAR [label="INPUTXBAR/\nPWMXBAR/\nOUTPUTXBAR"] PA30 -> ADC2; PA28 -> ADC2; PA26 -> ADC2 PA27 -> ADC1; PA18 -> ADC1 PA17 -> ADC0; PA16 -> ADC0 PWM4 -> PB3; PWM4 -> PA7 PWM4 -> PB1; PWM4 -> PA2 PWM4 -> PB2; PWM4 -> PA25 PWM4 -> ADC2 [label="SOCA trigger" style=dashed] PWM4 -> ADC1 [label="SOCA trigger" style=dashed] PWM4 -> ADC0 [label="SOCA trigger" style=dashed] PA30 -> CMPSS; PA27 -> CMPSS; PA17 -> CMPSS PB4 -> XBAR XBAR -> PWM4 [label="TripZone"] CMPSS -> XBAR XBAR -> ECAP0 XBAR -> PA11 PB8 -> XBAR [label="InputXBAR4"] PB9 -> XBAR [label="InputXBAR3"] PA8 -> XBAR [label="InputXBAR5"] XBAR -> ECAP1 [label="Hall speed"] }


1. MCPWM4 – Three-Phase PWM Generation

SysConfig instance: MTR1_MCPWM_BASE -> peripheral MCPWM4 Software handle: halFOCConfig_M1.pwmCfg.pwmHandle = MTR1_MCPWM_BASE_BASE

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 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 (stop), OST2 (nFAULT), OST3 (OC)

oneShotSource

Emulation mode

Free-run

DL_MCPWM_EMULATION_FREE_RUN

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

DRV8323RH 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. ADC – Current and Voltage Sensing

All three ADC instances are triggered synchronously by PWM4_SOCA (counter up, CmpC), ensuring simultaneous sampling at the PWM centre point.

digraph adc_routing { graph [fontname="helvetica" rankdir=LR label="ADC Sampling -- PWM4_SOCA Triggered"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=rectangle style=filled fillcolor="#A0A0FF"]; SOCA [label="PWM4_SOCA\n(TBCTR=U_CMPC)"] node [shape=rectangle style=filled fillcolor="#FFFFA0"]; SEQ0 [label="ADC0_SEQ1\n(SOC0->SOC1)"] SEQ1 [label="ADC1_SEQ1\n(SOC0->SOC1)"] SEQ2 [label="ADC2_SEQ1\n(SOC0->SOC1->SOC2)"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; S00 [label="ADC0_SOC0\nMTR1_IW_SEN"]; S01 [label="ADC0_SOC1\nMTR1_VU_SEN"] S10 [label="ADC1_SOC0\nMTR1_IV_SEN"]; S11 [label="ADC1_SOC1\nMTR1_VV_SEN"] S20 [label="ADC2_SOC0\nMTR1_IU_SEN"]; S21 [label="ADC2_SOC1\nMTR1_VW_SEN"] S22 [label="ADC2_SOC2\nMTR1_VDC_SEN"] INT1 [label="ADC0_INT1\n-> FOC ISR"] PPB1 [label="ADC1_PPB1\n(offset comp)"] node [shape=cds style=filled fillcolor="#A0FFA0"]; PA17[label="PA17\nAIN17"]; PA16[label="PA16\nAIN16"] PA27[label="PA27\nAIN29"]; PA18[label="PA18\nAIN18"] PA30[label="PA30\nAIN32"]; PA28[label="PA28\nAIN30"]; PA26[label="PA26\nAIN28"] SOCA -> SEQ0; SOCA -> SEQ1; SOCA -> SEQ2 SEQ0 -> S00; SEQ0 -> S01 SEQ1 -> S10; SEQ1 -> S11 SEQ2 -> S20; SEQ2 -> S21; SEQ2 -> S22 PA17 -> S00; PA16 -> S01 PA27 -> S10; PA18 -> S11 PA30 -> S20; PA28 -> S21; PA26 -> S22 S00 -> INT1 S10 -> PPB1 }

Signal Name

ADC Instance

SOC

AM13E230X Pin

AIN Channel

Measurement

MTR1_IW_SEN

ADC0 (ADC_0)

SOC0

PA17

AIN17

Phase W current

MTR1_VU_SEN

ADC0 (ADC_0)

SOC1

PA16

AIN16

Phase U voltage

MTR1_IV_SEN

ADC1 (ADC_1)

SOC0

PA27

AIN29

Phase V current

MTR1_VV_SEN

ADC1 (ADC_1)

SOC1

PA18

AIN18

Phase V voltage

MTR1_IU_SEN

ADC2 (ADC_2)

SOC0

PA30

AIN32

Phase U current

MTR1_VW_SEN

ADC2 (ADC_2)

SOC1

PA28

AIN30

Phase W voltage

MTR1_VDC_SEN

ADC2 (ADC_2)

SOC2

PA26

AIN28

DC bus voltage

ADC0_INT1 fires after SOC0 conversion completes and drives the FOC ISR (ADC0_INT1_IRQHandler / motor1CtrlISR). ADC1_PPB1 provides post-processing offset compensation for Phase V current.


3. CMPSS – Hardware Overcurrent Protection

Three CMPSS-Lite instances provide per-phase hardware overcurrent trip with a programmable DAC threshold (initial value 1800 counts, approximately 1.46 V on a 3.3 V reference).

digraph cmpss { graph [fontname="helvetica" rankdir=LR label="CMPSS Overcurrent Protection Path"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=cds style=filled fillcolor="#A0FFA0"]; PA30c [label="PA30\nIU (P input)"]; PA27c [label="PA27\nIV (P input)"] PA17c [label="PA17\nIW (P input)"] node [shape=triangle style=filled orientation=-90 fillcolor="#A0A0FF"]; CMP2 [label="CMPSS2\nMTR1_CMPSS_U"]; CMP1 [label="CMPSS1\nMTR1_CMPSS_V"] CMP0 [label="CMPSS0\nMTR1_CMPSS_W"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; DAC2 [label="DAC_H=1800\n(N input)"]; DAC1 [label="DAC_H=1800\n(N input)"] DAC0 [label="DAC_H=1800\n(N input)"] CTRIPH2 [label="CMPSS2_CTRIPH\n(FILTER,Invert)"] CTRIPH1 [label="CMPSS1_CTRIPH\n(FILTER,Invert)"] CTRIPH0 [label="CMPSS0_CTRIPH\n(FILTER,Invert)"] CTRIPOUTH2 [label="CMPSS2_CTRIPOUTH\n(ASYNC,Invert)"] CTRIPOUTH1 [label="CMPSS1_CTRIPOUTH\n(ASYNC,Invert)"] CTRIPOUTH0 [label="CMPSS0_CTRIPOUTH\n(ASYNC,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 -> PWM4\nOne-shot trip"] node [shape=cds style=filled fillcolor="#A0FFA0"]; PA11o [label="PA11\nIPD output"] PA30c -> CMP2; DAC2 -> CMP2 PA27c -> CMP1; DAC1 -> CMP1 PA17c -> CMP0; DAC0 -> CMP0 CMP2 -> CTRIPH2; CMP2 -> CTRIPOUTH2 CMP1 -> CTRIPH1; CMP1 -> CTRIPOUTH1 CMP0 -> CTRIPH0; CMP0 -> CTRIPOUTH0 CTRIPH2 -> PWMXBAR3; CTRIPH1 -> PWMXBAR3; CTRIPH0 -> PWMXBAR3 PWMXBAR3 -> TZ3 CTRIPOUTH2 -> OUTXBAR5; CTRIPOUTH1 -> OUTXBAR5; CTRIPOUTH0 -> OUTXBAR5 OUTXBAR5 -> PA11o }

CMPSS Instance

SysConfig Name

Phase

P-Input Pin

DAC-H Value

Filter Window

Trip Path

CMPSS2

MTR1_CMPSS_U_BASE

U (IU)

PA30

1800 counts

8 samples, prescale=1

PWMXBAR3 -> TZ3 (filtered)

CMPSS1

MTR1_CMPSS_V_BASE

V (IV)

PA27

1800 counts

8 samples, prescale=1

PWMXBAR3 -> TZ3 (filtered)

CMPSS0

MTR1_CMPSS_W_BASE

W (IW)

PA17

1800 counts

8 samples, prescale=1

PWMXBAR3 -> TZ3 (filtered)

Two trip paths are generated per phase:

  • Filtered path (CTRIPH -> PWMXBAR3 -> TZ3): debounced by the digital filter (8-sample window), inverted, routed to PWM one-shot trip zone 3.

  • Async path (CTRIPOUTH -> OUTPUTXBAR5 -> PA11): unfiltered async output used as the IPD (Initial Position Detection) capture input via ECAP0.

CMPSS2 DAC-L is additionally routed to PA4 as an analog output (MTR1_CMPSS_U_BASE_DAC, lowDAC.enableDACOUT = true).


4. Hall Sensor Interface

The Hall sensor interface is the key addition in this solution compared to the sensorless variant. Three Hall sensor signals are read via GPIO inputs, routed through the InputXBAR to ECAP1 for speed measurement, and decoded by the FOC algorithm to determine rotor position.

Hall GPIO Inputs

SysConfig group: MTR1_HALL

digraph hall_interface { graph [fontname="helvetica" rankdir=LR label="Hall Sensor Interface -- GPIO to ECAP1"]; node [fontname="helvetica" margin="0.15"]; edge [fontname="helvetica" fontsize=9]; node [shape=cds style=filled fillcolor="#A0FFA0"]; PB8 [label="PB8\nGPIO40\nHall A"] PB9 [label="PB9\nGPIO41\nHall B"] PA8 [label="PA8\nGPIO8\nHall C"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; IX4 [label="InputXBAR4\n(INPUT4)\nGPIO40/PB8"] IX3 [label="InputXBAR3\n(INPUT3)\nGPIO41/PB9"] IX5 [label="InputXBAR5\n(INPUT5)\nGPIO8/PA8"] node [shape=rectangle style=filled fillcolor="#A0A0FF"]; ECAP1 [label="ECAP1\nHALL_SPEED_CAP\nFree-run\nReset on Event1"] SW [label="HAL_Hall_updateEcapInput_inline()\nDirection-dependent\nXBAR selection"] node [shape=rectangle style=filled fillcolor="#FFFFA0"]; SPEED [label="speedHall_Hz\nangleHall_rad\n(sector lookup)"] PB8 -> IX4; PB9 -> IX3; PA8 -> IX5 IX3 -> ECAP1 [label="primary input\n(Hall B)"] IX4 -> SW [label="Hall A"] IX5 -> SW [label="Hall C"] SW -> ECAP1 [label="next-edge\nXBAR switch" style=dashed] ECAP1 -> SPEED [label="edge period\ncapture"] }

Hall Signal

GPIO Pin

GPIO Number

InputXBAR

SysConfig Name

Role

Hall A

PB8

GPIO40

InputXBAR4 (INPUT4)

HALL_SPEED_CAP_ECAP_INPUT_HALL_A

Sector decode + ECAP

Hall B

PB9

GPIO41

InputXBAR3 (INPUT3)

HALL_SPEED_CAP_ECAP_INPUT_HALL_B

Primary ECAP1 input

Hall C

PA8

GPIO8

InputXBAR5 (INPUT5)

HALL_SPEED_CAP_ECAP_INPUT_HALL_C

Sector decode + ECAP

Hall Speed Measurement (ECAP1)

SysConfig instance: HALL_SPEED_CAP -> ECAP1

Parameter

Value

Input source

InputXBAR3 (Hall B, GPIO41/PB9) — default; switched dynamically

Capture mode

Capture (not APWM)

Emulation mode

Free-run

Counter reset

On Event 1 (each captured edge resets the counter)

Speed calculation

Period between consecutive Hall edges -> speedHall_Hz

ECAP1 captures the time between consecutive Hall sensor edges. The counter is reset on each captured event, so the captured value directly represents the period of the Hall signal. The FOC algorithm converts this period to speed in Hz.

Direction-Dependent XBAR Switching

The Hall speed measurement uses HAL_Hall_updateEcapInput_inline() to dynamically switch the ECAP1 input between Hall A, B, and C via the InputXBAR. On each Hall state transition, the function selects the InputXBAR channel corresponding to the next expected Hall edge for the current motor direction. This ensures the ECAP always captures the most recent edge regardless of direction, maximising speed measurement resolution at all speeds.

The current motor direction is propagated from inputCtrl.direction into the Hall data handle before each call to HAL_Hall_readState().

Hall Sector to Angle Mapping

The three Hall GPIO inputs form a 3-bit sector code (Hall C, Hall B, Hall A). The FOC algorithm decodes this code using a lookup table to determine the electrical angle sector (0 to 5, each spanning 60 degrees). The sector midpoint angle is used as angleHall_rad and written to angleFOC_rad for the current controller.

Hall State (C,B,A)

Sector

Electrical Angle (approx.)

0b001 (A=1,B=0,C=0)

0

30 deg

0b011 (A=1,B=1,C=0)

1

90 deg

0b010 (A=0,B=1,C=0)

2

150 deg

0b110 (A=0,B=1,C=1)

3

210 deg

0b100 (A=0,B=0,C=1)

4

270 deg

0b101 (A=1,B=0,C=1)

5

330 deg

Note

The exact angle offsets depend on the physical Hall sensor placement relative to the motor poles. If the motor runs in the wrong direction or exhibits poor torque, adjust the Hall sensor wiring order (swap any two Hall wires) or update the sector-to-angle offset in the Hall configuration.


5. Crossbar (INPUTXBAR / PWMXBAR / OUTPUTXBAR)

The crossbar infrastructure routes fault and protection signals to the PWM trip zone, to the ECAP capture inputs, and to the Hall sensor speed measurement.

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)"] PB4x [label="PB4\nnFAULT"] PB8x [label="PB8\nHall A"] PB9x [label="PB9\nHall B"] PA8x [label="PA8\nHall C"] node [shape=rectangle style=filled fillcolor="#FFA0A0"]; IX1 [label="INPUTXBAR1\nMTR1_STOP_ACTION\n(Drive LOW)"] IX2 [label="INPUTXBAR2\nMTR1_nFAULT_TRIP\n(GPIO36/PB4)"] IX3 [label="INPUTXBAR3\nHALL_B\n(GPIO41/PB9)"] IX4 [label="INPUTXBAR4\nHALL_A\n(GPIO40/PB8)"] IX5 [label="INPUTXBAR5\nHALL_C\n(GPIO8/PA8)"] 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"] 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)"] ECAP0 [label="ECAP0\nIPD_CAPTURE"] ECAP1 [label="ECAP1\nHALL_SPEED_CAP"] node [shape=cds style=filled fillcolor="#A0FFA0"]; PA11x [label="PA11\nIPD output"] LOW -> IX1 -> PX1 -> TZ1 PB4x -> IX2 -> PX2 -> TZ2 PX3 -> TZ3 OX5 -> ECAP0 OX5 -> PA11x PB9x -> IX3 -> ECAP1 [label="primary"] PB8x -> IX4 PA8x -> IX5 }

Crossbar

SysConfig Name

Source

Destination

Purpose

INPUTXBAR1

MTR1_STOP_ACTION

Tied LOW

PWMXBAR1 -> TZ1

Software motor stop

INPUTXBAR2

MTR1_nFAULT_TRIP

PB4 (nFAULT GPIO)

PWMXBAR2 -> TZ2

Gate driver fault trip

INPUTXBAR3

HALL_SPEED_CAP_ECAP_INPUT_HALL_B

PB9 (Hall B, GPIO41)

ECAP1

Hall B speed capture (primary)

INPUTXBAR4

HALL_SPEED_CAP_ECAP_INPUT_HALL_A

PB8 (Hall A, GPIO40)

ECAP1 (switched)

Hall A speed capture

INPUTXBAR5

HALL_SPEED_CAP_ECAP_INPUT_HALL_C

PA8 (Hall C, GPIO8)

ECAP1 (switched)

Hall C speed capture

PWMXBAR3

MTR1_CMP_nFAULT_XBAR_INP

CMPSS0/1/2 CTRIPH (inverted)

TZ3

Hardware OC trip

OUTPUTXBAR5

IPD_ECAP_INPUT

CMPSS0/1/2 CTRIPOUTH

ECAP0 + PA11

IPD pulse capture


6. ECAP – IPD Capture and Hall Speed Capture

ECAP0 – IPD Pulse Capture

SysConfig instance: IPD_CAPTURE -> ECAP0

Parameter

Value

Input source

OUTPUTXBAR5 (async CMPSS trip OR of all 3 phases)

Capture mode

Capture (not APWM)

Emulation mode

Free-run

Sync-out

Disabled

Reset counters

Enabled

Capture event

DL_ECAP_EVENT_1 (rising edge of IPD pulse)

The ECAP captures the time between IPD current pulses to determine initial rotor position before starting the FOC algorithm.

ECAP1 – Hall Speed Capture

SysConfig instance: HALL_SPEED_CAP -> ECAP1

Parameter

Value

Input source

InputXBAR3 (Hall B default; switched dynamically by direction)

Capture mode

Capture (not APWM)

Emulation mode

Free-run

Counter reset

On Event 1 (each Hall edge resets counter)

Speed output

speedHall_Hz in statusVars


7. GPIO – Gate Driver Control

SysConfig group: MTR1_GATE_DRIVER

GPIO Name

Pin

Direction

Initial State

DRV8323RH Signal

GATE_EN_GPIO

PA3

Output

HIGH (enabled)

ENABLE

nFAULT_GPIO

PB4

Input

–

nFAULT

GATE_MODE_GPIO

PB7

Output

LOW (pull-down)

MODE

GATE_GAIN_GPIO

PB12

Input

–

GAIN

GATE_CAL_GPIO

PB11

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 (toggle in ISR)

SysConfig group: MTR1_HALL

GPIO Name

Pin

Direction

Purpose

A

PB8

Input

Hall sensor phase A

B

PB9

Input

Hall sensor phase B

C

PA8

Input

Hall sensor phase C


8. UART – Serial Data Plot

SysConfig instance: SERIAL_DATA_PLOT -> UC1

Parameter

Value

Baud rate

9 200 000 bps (9.2 Mbaud)

Oversampling

8x

FIFO

Enabled, TX threshold = empty, RX threshold = not-empty

TX pin

PA0

RX pin

PA1

RX interrupt

Enabled (for TI Tune command reception)

Digital glitch filter

4 cycles

Used for high-speed streaming of motor variables (currents, speed, angle) to MotorVision / TI Tune during development and tuning.


9. 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

PA1

–

UART RX

UC1

Serial plot RX (TI Tune)

PA2

–

PWM4_2B

MCPWM4

Phase B Low

PA3

–

GATE_EN

GPIO

DRV8323 ENABLE

PA4

AIN10

CMPSS2_DACL_OUT

CMPSS2

DAC analog output

PA7

–

PWM4_1B

MCPWM4

Phase A Low

PA8

–

Hall C / INPUTXBAR5

GPIO + XBAR

Hall sensor C

PA11

–

IPD_OUT

OUTPUTXBAR5

IPD async trip output

PA16

AIN16

MTR1_VU_SEN

ADC0 SOC1

Phase U voltage

PA17

AIN17

MTR1_IW_SEN / CMPSS0_P

ADC0 SOC0 / CMPSS0

Phase W current + OC

PA18

AIN18

MTR1_VV_SEN

ADC1 SOC1

Phase V voltage

PA23

–

ISR_TIMING

GPIO

ISR timing toggle

PA25

–

PWM4_3B

MCPWM4

Phase C Low

PA26

AIN28

MTR1_VDC_SEN

ADC2 SOC2

DC bus voltage

PA27

AIN29

MTR1_IV_SEN / CMPSS1_P

ADC1 SOC0 / CMPSS1

Phase V current + OC

PA28

AIN30

MTR1_VW_SEN

ADC2 SOC1

Phase W voltage

PA30

AIN32

MTR1_IU_SEN / CMPSS2_P

ADC2 SOC0 / CMPSS2

Phase U current + OC

PB1

–

PWM4_2A

MCPWM4

Phase B High

PB2

–

PWM4_3A

MCPWM4

Phase C High

PB3

–

PWM4_1A

MCPWM4

Phase A High

PB4

–

nFAULT_GPIO / INPUTXBAR2

GPIO + XBAR

DRV8323 nFAULT

PB6

–

FAULT_OUTPUT

GPIO

Fault indicator

PB7

–

GATE_MODE

GPIO

DRV8323 MODE

PB8

–

Hall A / INPUTXBAR4

GPIO + XBAR

Hall sensor A

PB9

–

Hall B / INPUTXBAR3

GPIO + XBAR

Hall sensor B (ECAP1 primary)

PB11

–

GATE_CAL

GPIO

DRV8323 CAL

PB12

–

GATE_GAIN

GPIO

DRV8323 GAIN