Tool/software: Code Composer Studio
I am using MSPware to generate a PWM waveform. The code is given below:
#define TIMER_PERIOD 13105
#define DUTY_CYCLE 825
void main (void)
{
//Stop WDT
WDT_A_hold(WDT_A_BASE);
//P2.0 as PWM output
GPIO_setAsPeripheralModuleFunctionOutputPin(
GPIO_PORT_P2,
GPIO_PIN0
);
//Generate PWM - Timer runs in Up mode
Timer_A_outputPWMParam param = {0};
param.clockSource = TIMER_A_CLOCKSOURCE_ACLK;
param.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
param.timerPeriod = TIMER_PERIOD;
param.compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1;
param.compareOutputMode = TIMER_A_OUTPUTMODE_SET_RESET;
param.dutyCycle = DUTY_CYCLE;
Timer_A_outputPWM(TIMER_A1_BASE, ¶m);
//Enter LPM0
__bis_SR_register(LPM0_bits);
//For debugger
__no_operation();
}
When I connect my multimeter across P2.0, I see voltage swing from [2.63,3.26]. Can someone tell me why it is not going 0 all the way?




