| ||||||||
Technical Support Support Resources Product Information | C51: LITTLE-ENDIAN CAN REGISTERS, BIG-ENDIAN COMPILERInformation in this article applies to:
QUESTIONThe C51 compiler stores unsigned ints in big-endian format, however the CAN registers on the C505 are stored in little-endian format. Is there a way to make the compiler store unsigned ints in little-endian format so I can write to the 16-bit CAN registers? ANSWERThe C166 family stores 16-bit values in little-endian format. When the CAN peripheral was copied over to the 8051 devices, the registers were left in the same format, however the architecture of 8051s is big-endian. There is no way to make the compiler store unsigned ints in little-endian format, so the CAN registers have to be loaded in single bytes, high and low. MORE INFORMATION
Last Reviewed: Friday, July 15, 2005 | |||||||
| ||||||||