Hi,
yes this problem is due to big endian.
in addition, in Freesacle MCU,
Big Endian : HCS12(X), HC(S)08, ColdFire, …
Little Endian : DSC and Kinetis.
user can write convert code by themselves
The quickest way for converting 2-byte and 4-byte data is to define macros:
/*applicable to both integer or floating point number which originally written for HC12*/
#define EndianConvert16(w) ((w>>8)|(w<<8))
#define EndianConvert32(dw) ((dw<<24)|((dw>>8)&0xFF00)|((dw<<8)&0xFF0000)|(dw>>24))
can this help?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------