Part Number: MSP432P401R
I am trying to output a pwm signal with a period of 20ms and a duty cycle of 2 ms to make a servo motor spin. It is not working at all. I am assuming that the SMCLK frequency is 12 MHz, although I may be wrong. I was also wondering why the line #define TIMER_A_CLOCKSOURCE_DIVIDER_1 0x78 was throwing an error. Thanks so much!
#include <ti/devices/msp432p4xx/driverlib/driverlib.h> /* Standard Includes */ #include <stdint.h> #include <stdbool.h> #define TIMER_A_CLOCKSOURCE_DIVIDER_1 0x78 Timer_A_PWMConfig pwmConfig = { TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, 2000, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_OUTPUTMODE_RESET_SET, 20 }; int main(void) { /* Stop Watchdog */ MAP_WDT_A_holdTimer(); GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION); Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig); while(1) { }