XA-G49 (8051 extended architecture) I/O Port Bit-Addressing Question

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi.

The P3 I/O port in my application has some bits used for output-only
and some for input-only.  The output-only bits are configured in
push-pull mode and the input-only ones in quasi-bidirectional.

In quasi-bidirectional mode I have to write a '1' to the bit latch, so
as to not pull the line down myself.


My question:  Can I use bit set/bit clear instructions (CLR, SETB) on
the output-only bits without clobbering the bit-latch for the input
bit?


If SETB/CLR are implemented as RMW, and the input value is zero, that
will clobber the latch, but if the SFR is truly bit-addressable at the
lowest level, then a bit operation won't clobber neighboring bits.

Here's an example to clarify my question:

  Suppose bit-7 is my input pin and bit 0 is my output pin.

  I want to set the output latch on bit 7 to '1' so as to allow the
  external device to drive it.  I can do this with the instruction:

      setb P3.7

  If the device is currently driving the pin low, I'll get a zero
  in bit-7 if I read P3 back.

  Now say I want to drive out a '1' on my output bit, bit 0.
  I *could* do this with:

      setb P3.0

  But if this is implemented internally as a read-modify-write, it
  could do:

      P3 <- P3 OR 1

  As a read of P3 gives a zero in bit 7, this would clear bit 7,
  which is obviously undesired - my input bit is pulled low by the
  latch and that's the end of that.

  However, the chip implements:

      P3.0 <- 1

  Natively, then the P3.7 bit latch is untouched.

The XA User Manual does not specifically address this, although the
device is supposed to be operationally compatible with the 8051,
and I hope there are many 8051/XA-savvy people out there who could
help me out!

Thanks,
Paul.

Re: XA-G49 (8051 extended architecture) I/O Port Bit-Addressing Question
snipped-for-privacy@yahoo.com (Paul Marciano) wrote in message

Quoted text here. Click to load it

Ok, actually it does (page 7-16).  So I'm good to go.

Quoted text here. Click to load it

Apparently not.  Not a single message.  I guess 8051 architecture
microcontrollers aren't popular.

Re: XA-G49 (8051 extended architecture) I/O Port Bit-Addressing Question


Quoted text here. Click to load it

Well, I've used the XA-G49 on a couple of jobs, gave up because it's too
thirsty, but these days I only use assembler when I have to. Life is
short, and anyway I'm not really interested in device- specific
characteristics, keep it C and general, and I can port it to something
else if I need to. But Philips really messed up when they designed the
XA series, as it's NOT pin compatible with the 8051 if you use an
external bus.

Paul Burke


Site Timeline