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
1. MCPWM0 — Three-Phase PWM Generation
SysConfig instance: MTR1_MCPWM_BASE → peripheral MCPWM0
Parameter |
Value |
|---|---|
Counter mode |
Up-Down (centre-aligned), |
Time-base period |
|
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 ( |
Trip action |
Force A and B 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 |
|---|---|---|---|---|---|
|
|
SOC0 |
PA30 |
AIN32 |
Phase W current |
|
|
SOC1 |
PA27 |
AIN29 |
Phase U voltage |
|
|
SOC0 |
PB27 |
AIN37 |
Phase V current |
|
|
SOC1 |
PB30 |
AIN40 |
Phase V voltage |
|
|
SOC0 |
PB28 |
AIN38 |
Phase U current |
|
|
SOC1 |
PA29 |
AIN31 |
Phase W voltage |
|
|
SOC2 |
PC7 |
AIN19 |
DC bus voltage |
ADC_0does not setadcBasein the.syscfg(SysConfig default),ADC_1isADC1andADC_2isADC2.ADC_0INT1 is registered as the FOC interrupt, namedmotor1CtrlISR, with priority 0. The.syscfgsetsenable = falsefor this interrupt, so it is not enabled by the SysConfig-generated initialization.ADC_1andADC_2each enable post-processing blockPPB1.
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 |
|---|---|---|---|---|
|
CMPSS0 (default) |
PB28 |
U ( |
prescale 1, window 8, threshold 8 |
|
CMPSS1 |
PB27 |
V ( |
prescale 1, window 8, threshold 8 |
|
CMPSS2 |
PA30 |
W ( |
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 |
|
Driven low ( |
|
Software motor stop |
INPUTXBAR2 |
|
|
|
Gate driver fault trip |
PWMXBAR |
|
CMPSS0/1/2 CTRIPH, inverted |
Trip |
Hardware overcurrent trip |
OUTPUTXBAR5 |
|
|
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 |
|
Reset counters |
Enabled |
Sync-out |
Disabled ( |
Capture event |
|
6. GPIO — Gate Driver Control and Diagnostics
SysConfig group: MTR1_GATE_DRIVER
GPIO Name |
Pin |
Direction |
Notes |
DRV8323RH Signal |
|---|---|---|---|---|
|
PB31 |
Output |
Initial value SET, pull-up |
ENABLE |
|
PA26 |
Input |
Standard-drive IO structure |
nFAULT |
|
PB7 |
Output |
Pull-down |
MODE |
|
PD5 |
Input |
GAIN |
|
|
PC31 |
Output |
CAL |
SysConfig group: MTR1_FOC_CTRL
GPIO Name |
Pin |
Direction |
Purpose |
|---|---|---|---|
|
PB6 |
Output |
Fault indicator output |
|
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 |
|
VREF source |
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 |
|
OUTPUTXBAR5 |
IPD async trip output |
PA23 |
|
GPIO |
ISR timing toggle |
PA26 |
|
GPIO + XBAR |
DRV8323RH nFAULT |
PA27 |
|
ADC_0 SOC1 |
Phase U voltage |
PA29 |
|
ADC_2 SOC1 |
Phase W voltage |
PA30 |
|
ADC_0 SOC0 / CMPSS2 |
Phase W current + OC |
PB6 |
|
GPIO |
Fault indicator |
PB7 |
|
GPIO |
DRV8323RH MODE |
PB27 |
|
ADC_1 SOC0 / CMPSS1 |
Phase V current + OC |
PB28 |
|
ADC_2 SOC0 / CMPSS0 |
Phase U current + OC |
PB30 |
|
ADC_1 SOC1 |
Phase V voltage |
PB31 |
|
GPIO |
DRV8323RH ENABLE |
PC7 |
|
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 |
|
GPIO |
DRV8323RH CAL |
PD5 |
|
GPIO |
DRV8323RH GAIN |