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.

EK-TM4C123GXL: Send float data over uart with dma

Part Number: EK-TM4C123GXL

Hello,

1. i would like to send float values via uart.
is this possible?
in the example from tivaware, 8 bit data is always accepted.
is it also possible to send 32 bit float data?

2. would this also work completely without an interpreter?
by this i mean send the float values as hex values directly via uart.
the plan would then be ping pong dma.
source sram array variable and destination uart fifo.

3. My next project is:
1. sample frequencies with the ADC.
2. change these samples with FIR IIR etc filter.
3. output the changed signal via UART, so I can see the change.There are some UART oscilloscopes online for download.
Or does anyone have a better idea ?

  • Hi,

      To send through UART, below is a snippet of example. First convert your float into a string using usprintf. Then you can use the UARTprintf to send the string out. 

    void
    DisplayIPAddress(uint32_t ui32Addr)
    {
    char pcBuf[16];

    //
    // Convert the IP Address into a string.
    //
    usprintf(pcBuf, "%d.%d.%d.%d", ui32Addr & 0xff, (ui32Addr >> 8) & 0xff,
    (ui32Addr >> 16) & 0xff, (ui32Addr >> 24) & 0xff);

    //
    // Display the string.
    //
    UARTprintf(pcBuf);
    }

    Below is another example to send float through UART.

    fTemperature = (float)(-46.85 + 175.72 * (float)pui32DataRx[0]/65536);

    //
    // Convert the floats to an integer part and fraction part for easy
    // print.
    //
    i32IntegerPart = (int32_t) fTemperature;
    i32FractionPart = (int32_t) (fTemperature * 1000.0f);
    i32FractionPart = i32FractionPart - (i32IntegerPart * 1000);
    if(i32FractionPart < 0)
    {
    i32FractionPart *= -1;
    }

    //
    // Print the temperature as integer and fraction parts.
    //
    UARTprintf("Temperature %3d.%03d\n", i32IntegerPart, i32FractionPart);