======================================================================
#include <msp430x20x3.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
BCSCTL3 |= LFXT1S_2;
======
Here input and output Port and timer A initialized
======
======
TBCTL= TBCLGRP | CNTL_0 | MC_0 | TBSSEL_1 | ID_3 | TBCLR; // reset it, first.
TBCCTL0= CCIE; // set the mode.
TBCCR0 = 512-1; // PWM Period
TBCCTL1 = OUTMOD_7; // CCR1 reset/set
TBCTL = TASSEL_1 + MC_1; // ACLK, up mode
IFG1 &= ~OFIFG;
BCSCTL2 = SELM_3 | DIVM_3;
Switch Interrupt routine 1; "For" loop is used for PWM for LED_ON and LED_OFF
=========================
Timer A Interrupt routine; "For" loop is used for PWM for LED_OFF
=========================