How to use TA1 of P1.6 without also using it on P1.2 on MSP430F1101
Your bit operations are wrong.
  P1DIR=0;

This configures all eight P1.x pins as inputs.
  P1SEL= ~BIT2;

This configures all P1.x pins except P1.2 for the module function; P1.2 is GPIO.
To output the PWM signal to P1.2, you need:
P1DIR |= BIT2;
P1SEL |= BIT2;

To output the PWM signal to P1.6, you need:
P1DIR |= BIT6;
P1SEL |= BIT6;

Please note that P1.2 can be used as both timer input or output, while P1.6 can be used only as timer output (see pages 26/27 of the datasheet).