|ARM Technical Support Knowledge Articles|
Applies to: C166 C Compiler
Information in this article applies to:
I am porting a working application from an 8-bit microcontroller to a C16x device. The following code works just fine on the C16x:
#define test MVAR (unsigned short, 0x120000) test = 100;
However, the following code does not work:
#define test MVAR (unsigned short, 0x120001) test = 100;
When executing the second example, the program halts. What's going on?
The problem is that the C16x can only access words on word boundaries (even addresses). The C16x devices generate a Class B hardware trap when a word is accessed on an odd address (non-word boundary).
This problem doesn't occur on 8-bit devices because there is no boundary limitations on those parts.
Article last edited on: 2005-01-30 14:17:05
Did you find this article helpful? Yes No
How can we improve this article?