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.

TMS320F28379D: Cast 32-bit to a Float

Part Number: TMS320F28379D

Hello,

I have a simple code that reads some data from UART and converts it to float, and I've encountered a problem:

uint32_t temp1;
float vel;

vel = (float) temp1;        // ERROR: the hexadecimal data in temp1 and vel is not the same !!

memcpy((void*)&vel, (void*)&temp1, 2);           // OK!

How come casting to float is not working as expected?