void ClkInit()
{
PJSEL0 |= BIT4 + BIT5;
CSCTL0_H = 0xA5;
CSCTL4 = XT1DRIVE_2 + XTS; //HF MODE 2
CSCTL2 = SELA_1 + SELS_0 + SELM_0; //ACLK = VLO; MCLK = XT1/8
CSCTL3 = DIVA_0 + DIVS_0 + DIVM_3; //SMCLK = XT1
do
{
CSCTL5 &= ~XT1OFFG;
}
while(CSCTL5 & XT1OFFG);
PJSEL0 |= BIT0 + BIT1 + BIT2;
PJDIR |= BIT0 + BIT1 + BIT2; //OUTPUT MCLK SMCLK ACLK
}