+ Reply to Thread
Results 1 to 2 of 2

Thread: float and int value TX problem in UART(XMC4500, DAVE4)

  1. #1
    New Member New Member huron is on a distinguished road
    Join Date
    Oct 2016

    float and int value TX problem in UART(XMC4500, DAVE4)


    I started DAVE4 and XMC4500 to use UART TX and RX
    and I checked the format of UART TX , RX function such as
    -UART_STATUS_t UART_Transmit(const UART_t *const handle, uint8_t* data_ptr, uint32_t count)
    -UART_STATUS_t UART_Receive(const UART_t *const handle, uint8_t* data_ptr, uint32_t count)

    I would like to Transmit float and int value(ex: float a=2.3453, int b=23) by UART TX
    How do I solve this probl


    #include <DAVE.h> //Declarations from DAVE Code Generation (includes SFR declaration)

    int main(void)

    float a=2.3453, int b=23; //How do I Transmit float and int variable in UART of DAVE4 ??

    uint8_t init_data[] = "Press enter if you want to receive a message";
    uint8_t send_data[] = "\nHello world!";
    uint8_t read_data = 0x0;

    DAVE_Init(); /* Initialization of DAVE APPs */

    /* Transmit the introduction message */
    UART_Transmit(&UART_0, init_data, sizeof(init_data));

    /* Read the data */
    UART_Receive(&UART_0, &read_data,1);
    if(read_data == 0xD)
    /* Transmit the message */
    UART_Transmit(&UART_0, send_data, sizeof(send_data));
    read_data = 0x0;
    return 0;

  2. #2
    Beginner Beginner
    Infineon Employee
    Infineon Employee
    Andi_H is on a distinguished road
    Join Date
    Dec 2014

    you have to use the "sprintf" function (float, int and so on to string....)

    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

+ Reply to Thread

Tags for this Thread


All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.

Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.