|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
I'm using a Philips 552 and accessing port 5. However, I'm not sure that P5 is bit addressable. Is it? If not, how can I access individual bits of this port?
P5 of the 552 is not bit-addressable. Only those SFRs whose address ends in 0 or 8 are bit-addressable. For example, SFRs at addresses 0x90 and 0xC8 are bit addressable while an SFR at address 0x94 is not.
Use the bitwise AND and OR operators of the C language to set and clear individual bits in P5. For example:
P5 |= 1 << 6; // Set Bit 6 in P5 P5 &= ~(1 << 5); // Clear Bit 5 in P5
Article last edited on: 2004-06-15 16:18:49
Did you find this article helpful? Yes No
How can we improve this article?