HI Charudatta,
CW offers some tools which could be configured to Big or Little endian, but these tools was created for operations like dump from or load to memory and display data in memory window.
So, you can just display/export/import content of Flash/EEPROM/RAM in appropriate orde, but S12Z core works also with data in Big Endian order. For more details about memory window, please look at chapter “7.5.15 Can I change the endianness that is displayed in the Memory view?” in document:
"c:\Freescale\CW MCU v10.6\MCU\Help\PDF\Microcontrollers_FAQ_Guide.pdf"
If you will need swap between endian orders for some IO functions, probably you will have to use some conversion functions. As example you could look at standard POSIX htonl(), htons(), ntohl(), ntohs() functions.
/* Macros for converting values between big-/little-endian byte order */
#define _SWAP2BYTE_CONST(n) ((((n) & 0x00FF) << 8) | (((n) & 0xFF00) >> 8))
#define _SWAP4BYTE_CONST(n) ((((n) & 0x000000FF) << 24) | (((n) & 0x0000FF00) << 8) | (((n) & 0x00FF0000) >> 8) | (((n) & 0xFF000000) >> 24))
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------