while ((UC1IFG & UCA1TXIFG) == 0); //loop until buffer is free
UCA1TXBUF = x; /* send the character */
while(!(UC1IFG & UCA1TXIFG));
while ((UC1IFG & UCA1TXIFG) == 0); //loop until buffer is free
UCA1TXBUF = x; /* send the character */
while(!(UC1IFG & UCA1TXIFG));