#include
#define pwm_sf 200
#define pwm_vf 1000
void pwm_sinit(unsigned char pwmvalue1)
{
TACTL = TASSEL_2 + MC_1;
CCR0 = 1002000/pwm_sf;
CCTL1 = OUTMOD_7;
CCR1 = (1002000*pwmvalue1)/(100*pwm_sf);
P1DIR |= 0x15;
P1SEL |= 0x15;
}
/*
void pwm_vinit(unsigned char pwmvalue2)
{
// TACTL = TASSEL_2 + MC_1;
CCR0 = 100200/pwm_vf;
CCTL2 = OUTMOD_7;
CCR2 = 1002000*pwmvalue2/100;
P2DIR |= 0x10;
P2SEL |= 0x10;
}
*/
void main(void)
{
WDTCTL = WDTPW +WDTHOLD;
DCOCTL=CALDCO_1MHZ;
BCSCTL1=CALBC1_1MHZ;
pwm_sinit(50);
//pwm_vinit(50);
BCSCTL3 = XCAP_2;
while(1)
{;}
}