This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Flushing of tx buffer in msp430g2553

Other Parts Discussed in Thread: MSP430G2553

Hello,

I ma using MSP430G2553 microcontroller and  trying to send hex data on uart  (through rs485 to rs232 converter ) but receiving initial character as null(0x00).

Is there any command to flush the transmitter buffer since i did not get it anywhere. Please help me, I am stuck here.

Following is code of transmitting a character:


void UART_PUTCHAR(unsigned char putchar)
{
                while(!(IFG2 & UCA0TXIFG));
                UCA0TXBUF=putchar;               
}

in main function :

UART_PUTCHAR(0x01);
                   UART_PUTCHAR(0x04);
                   UART_PUTCHAR(0x00);
                   UART_PUTCHAR(0x00);
                   UART_PUTCHAR(0x00);
                   UART_PUTCHAR(0x15);
                   UART_PUTCHAR(0x55);
                   UART_PUTCHAR(0x99);
                   UART_PUTCHAR(0xab);

                   UART_PUTCHAR(0x71);
                   UART_PUTCHAR(0xcb);
 I have initialized uart correctly and transmitted ascii string successfully,  only in hex data it show first byte as null. Please help me, I am stuck here.

**Attention** This is a public forum