#include <msp430x16x.h>
#include <stdio.h>


void delay(unsigned int time);
void Init_servo(void);

void Init_servo(){
    
    P4DIR |= 0xff;
    P4SEL |= 0xff;

    TBCTL = TBSSEL_2 + MC_1 + ID_0; //SUb master clock a 1 MHz//conf.
   
    TBCCR0 = 20000;
    
    TBCCTL1 = OUTMOD_7;
    TBCCTL2 = OUTMOD_7;
   
}
 
  
void delay(unsigned int time)
{
   unsigned int e,i;
   for(i=0;i<time;i++)
   {
        for(e=0;e<50;e++)
	{   	   
	  asm("NOP");
        }
   }
}
