TACTL=TASSEL_1+TACLR;
//BCSCTL1=DIVA_1;
//CCTL1=OUTMOD_2;
TACCR0=500;
CCR1=200;
TACTL |=MC_1;
while(1)
{
for(i=1;i<8;i++)
{
switch(mode)
{
case 1:CCTL1|=OUTMOD_1;break;
case 2:CCTL1|=OUTMOD_2;break;
case 3:CCTL1|=OUTMOD_3;break;
case 4:CCTL1|=OUTMOD_4;break;
case 5:CCTL1|=OUTMOD_5;break;
case 6:CCTL1|=OUTMOD_6;break;
case 7:CCTL1|=OUTMOD_7;break;
}
if(i==7)
i=1;
for(j=256;j>0;j--);
}