Specifications

C8051F330/1
120 Rev. 1.1
14.3. General Purpose Port I/O
Port pins that remain unassigned by the Crossbar and are not used by analog peripherals can be used for general pur-
pose I/O. Ports2-0 are accessed through corresponding special function registers (SFRs) that are both byte address-
able and bit addressable. When writing to a Port, the value written to the SFR is latched to maintain the output data
value at each pin. When reading, the logic levels of the Port's input pins are returned regardless of the XBRn settings
(i.e., even when the pin is assigned to another signal by the Crossbar, the Port register can always read its correspond
-
ing Port I/O pin). The exception to this is the execution of the read-modify-write instructions that target a Port Latch
register as the destination. The read-modify-write instructions when operating on a Port SFR are the following: ANL,
ORL, XRL, JBC, CPL, INC, DEC, DJNZ and MOV, CLR or SETB, when the destination is an individual bit in a Port
SFR. For these instructions, the value of the register (not the pin) is read, modified, and written back to the SFR.