Keil™, An ARM® Company

Technical Support

C51: ACCESSING BITS ON P5 OF PHILIPS 552


Information in this article applies to:

  • C51 Version 5.50
  • C51 Version 6.00 Beta
  • C51 Version 6.00

SYMPTOMS

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?

CAUSE

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.

RESOLUTION

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

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Tuesday, June 15, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure