TIDUF67 April 2024 – December 2024
The SysConfig file configures the PWM channels. The base addresses of the PWM channels that are used for the motor controller PWM inputs are defined in the hal.h file, and the base addresses are assigned to the PWM handles in the hal.c file. The connection diagram for the PWM signals between the LP-AM263 and BOOSTXL-3PHGANINV is shown in Figure 4-47.
The code to configure the PWM signals is shown in the following, taken from the .syscfg, hal.h and hal.c files.
The base addresses of the PWM modules are defined in the hal.h file as shown in the following.
#define MTR1_PWM_U_BASE CONFIG_EPWM13_BASE_ADDR
#define MTR1_PWM_V_BASE CONFIG_EPWM3_BASE_ADDR
#define MTR1_PWM_W_BASE CONFIG_EPWM9_BASE_ADDR
The GPIOs are set up as PWM outputs in the .syscfg file.
// initialize PWM handles for Motor 1
obj->pwmHandle[0] = MTR1_PWM_U_BASE; //!< the PWM handle
obj->pwmHandle[1] = MTR1_PWM_V_BASE; //!< the PWM handle
obj->pwmHandle[2] = MTR1_PWM_W_BASE; //!< the PWM handle
EPWM Action Qualifier Configurationshows the EPWM action qualifier output event configuration forLP-AM263 and BOOSTXL-3PHGANINV combination. PWM action qualifier outputs need to be set up based on the hardware board.
Figure 4-51 shows the EPWM dead-band configuration for LP-AM263 . Swap output is checked for EPWMxA-B to match the high side and low side PWMs in LaunchPad™ and Booster Pack™.