Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: MSP432 PWM setting Output PIN problem

$
0
0
Hi, so i manage to output 4 PWMs from TA0.x: extern Timer_A_PWMConfig pwmConfig = { TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, 24000, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_OUTPUTMODE_RESET_SET, 12000 }; extern Timer_A_PWMConfig pwmConfig2 = { TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, 24000, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_OUTPUTMODE_RESET_SET, 12000 }; extern Timer_A_PWMConfig pwmConfig3 = { TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, 24000, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_OUTPUTMODE_RESET_SET, 12000 }; extern Timer_A_PWMConfig pwmConfig4 = { TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, 24000, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_OUTPUTMODE_RESET_SET, 12000 }; MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN4,GPIO_PRIMARY_MODULE_FUNCTION); MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN5,GPIO_PRIMARY_MODULE_FUNCTION); MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN6,GPIO_PRIMARY_MODULE_FUNCTION); MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN7,GPIO_PRIMARY_MODULE_FUNCTION); MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig); MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig2); MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig3); MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig4);

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>