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.

CCS/EVM430-FR6047: Float to string conversion

Part Number: EVM430-FR6047

Tool/software: Code Composer Studio

Hi,

I couldn't observe float values as an UART output so i decided to convert the value to string and then transmit it.

But unfortunately i could not achieve that.

Heres the code snippet and it would be a great help if i know where i went wrong.

float data=10.0;

char data1[20];

int SerialTransmission_UART(char data)
{
    WDTCTL = WDTPW | WDTHOLD;               // Stop Watchdog
    PM5CTL0 &= ~LOCKLPM5;

    UCA3CTLW0 = UCSWRST;                    // Put eUSCI in reset
    UCA3CTLW0 |= UCSSEL__SMCLK;             // CLK = SMCLK
    UCA3BRW = 52;                           // 8000000/16/9600
    UCA3MCTLW |= UCOS16 | UCBRF_1 | 0x4900;
    UCA3CTLW0 &= ~UCSWRST;                  // Initialize eUSCI
    UCA3IE |= UCRXIE;                       // Enable USCI_A0 RX interrupt
    sprintf(data1,"%f",data);
    UCA3TXBUF =data1;

    //__bis_SR_register(LPM3_bits + GIE);     // Enter LPM3, interrupts enabled
    __no_operation();                       // For debugger
    return 0;
}

Best Regards,

Divya

**Attention** This is a public forum