Good day! Please help me set up PWM on Timer_A0 using TI-RTOS APIs. Default PWM init on TA1 with port remapping on P2.1 and P2.2 (LED_GREEN and LED_BLUE for PWM examples). I want to use P2.4 and P2.5 (TA0.1 and TA0.2). I assume that it is necessary to make changes in Board.h, MSP_EXP432P401.h and MSP_EXP432P401.c files. But my program calls abort. Apparently I don't consider something.
I made the following changes:
Board.h ... #define Board_PWM0 MSP_EXP432P401R_PWM_TA0_1 #define Board_PWM1 MSP_EXP432P401R_PWM_TA0_2 ...
MSP_EXP432P401R.h ... typedef enum MSP_EXP432P401R_PWMName { MSP_EXP432P401R_PWM_TA0_1 = 0, MSP_EXP432P401R_PWM_TA0_2, MSP_EXP432P401R_PWMCOUNT } MSP_EXP432P401R_PWMName; ...
const PWMTimerMSP432_HWAttrs pwmTimerMSP432HWAttrs[MSP_EXP432P401R_PWMCOUNT] = { { .baseAddr = TIMER_A0_BASE, .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1 }, { .baseAddr = TIMER_A0_BASE, .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_2 } };
MSP_EXP432P401R.c ... void MSP_EXP432P401R_initPWM(void) { /* Enable PWM output on GPIO pins */ GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN4 | GPIO_PIN5, GPIO_PRIMARY_MODULE_FUNCTION); PWM_init(); } ...
Thanks!