| ??? 05/30/02 09:06 Read: times |
#23635 - RE: any way of reading P2 SFR ?,donald |
Donal are right in sense of the Intel MCS51
manual, I think. If you have other experiences, put the question to your MCU producer whether is their MCU "read-modify–write" compatible with Intel. The Intel MCS51 compatible MCU manuals write generally this: The normal read instructions will read the pin state without regard to the output data latch. The only exception is the read-modify–write category of instructions. They are listed as follows.
ANL (logicalAND, e.g.,ANL PI, A)
ORL (logicalOR, e.g.,ORL P2, A)
XRL (logicalEXIOR,e.g.,XRL P3, A)
JBC (jump if bit = 1 and clear bit,
e.g.,JBC P1.1,LABEL)
CPL (complementbit, e.g., CPL P3.0)
INC (increment,e.g.,INC P2)
DEC (decrement,e.g.,DEC P2)
DJNZ (decrernent and jump if not zero,
e.g., DJNZ P3, LABEL)
MOV PX.Y,C (movecarry bit to bit Y of Port X)
CLR PX.Y (clear bit Y of Port X)
SETB PX.Y (set bit Y of Port X)
Vaclav |



