ARM Technical Support Knowledge Articles

LITTLE-ENDIAN CAN REGISTERS, BIG-ENDIAN COMPILER

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

The 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?

ANSWER

The 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

Article last edited on: 2005-07-15 12:09:44

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential