SLUUDM5 March 2026 MSPM0G1507 , MSPM0G1519 , MSPM0G3507 , MSPM0G3519
Using TIMA0 of MSPM0 to enable three pairs of complementary PWM output and deadband time insertion for FOC application. There have four output channels of TIMA0, and users can select any three of them for FOC application.
When the hardware circuit is finalized, users should pay attention to the correspondence between the motor phase sequence and PWM channel setting. The default mapping relationship for sensorless-foc_DRV8316_LP_MSPM0G3507 project is shown in the following table.
| Board Layer | HAL Layer | Descriptions | ||
|---|---|---|---|---|
| SysConfig Layer | ||||
| Board Macro | IO PIN | PWM Channel | HAL Layer Macro | |
| INHA | PB4 | TIMA0_C2 | FOC_PWMA0_U_IDX | Phase A PWM output. |
| INHB | PA28 | TIMA0_C3 | FOC_PWMA0_V_IDX | Phase B PWM output. |
| INHC | PB20 | TIMA0_C1 | FOC_PWMA0_W_IDX | Phase C PWM output. |
| FAULT | PA27 | Fault Pin 2 | NOT USED | Gate driver output fault pin. |
| NA | NA | TIMA0_C0 | FOC_PWMA0_ADC_TRIG_IDX | Trigger channel from PWM to ADC. |
The HAL Layer Macro always keeps the same mapping relationship to the Board Macro, and the SysConfig layer should be modified accordingly.
In current FOC applications, the unused PWM channel is configured as ADC trigger channel, but the PIN output function is enabled in the project. Users can disable it manually in the main loop code, or use the non-output channel (CC4 or CC5), to get rid of this PWM PIN output impact.