C505_9708 SIEMENS [Siemens Semiconductor Group], C505_9708 Datasheet - Page 76
C505_9708
Manufacturer Part Number
C505_9708
Description
8-Bit CMOS Microcontroller
Manufacturer
SIEMENS [Siemens Semiconductor Group]
Datasheet
1.C505_9708.pdf
(227 pages)
- Current page: 76 of 227
- Download datasheet (2Mb)
6.1.6 Read-Modify-Write Feature of Ports 0 to 4
Some port-reading instructions read the latch and others read the pin. The instructions reading the
latch rather than the pin read a value, possibly change it, and then rewrite it to the latch. These are
called "read-modify-write"- instructions, which are listed in table 6-3. If the destination is a port or a
port pin, these instructions read the latch rather than the pin. Note that all other instructions which
can be used to read a port, exclusively read the port pin. In any case, reading from latch or pin,
resp., is performed by reading the SFR P0, P2 and P3; for example, "MOV A, P3" reads the value
from port 3 pins, while "ANL P3, #0AAH" reads from the latch, modifies the value and writes it back
to the latch.
It is not obvious that the last three instructions in table 6-3 are read-modify-write instructions, but
they are. The reason is that they read the port byte, all 8 bits, modify the addressed bit, then write
the complete byte back to the latch.
Table 6-3
"Read-Modify-Write"-Instructions
Instruction
ANL
ORL
XRL
JBC
CPL
INC
DEC
DJNZ
MOV Px.y,C
CLR Px.y
SETB Px.y
The reason why read-modify-write instructions are directed to the latch rather than the pin is to avoid
a possible misinterpretation of the voltage level at the pin. For example, a port bit might be used to
drive the base of a transistor. When a "1" is written to the bit, the transistor is turned on. If the CPU
then reads the same port bit at the pin rather than the latch, it will read the base voltage of the
transitor (approx. 0.7 V, i.e. a logic low level!) and interpret it as "0". For example, when modifying
a port bit by a SETB or CLR instruction, another bit in this port with the above mentioned
configuration might be changed if the value read from the pin were written back to th latch. However,
reading the latch rather than the pin will return the correct value of "1".
Semiconductor Group
Function
Logic AND; e.g. ANL P1, A
Logic OR; e.g. ORL P2, A
Logic exclusive OR; e.g. XRL P3, A
Jump if bit is set and clear bit; e.g. JBC P1.1, LABEL
Complement bit; e.g. CPL P3.0
Increment byte; e.g. INC P4
Decrement byte; e.g. DEC P5
Decrement and jump if not zero; e.g. DJNZ P3, LABEL
Move carry bit to bit y of port x
Clear bit y of port x
Set bit y of port x
6-14
On-Chip Peripheral Components
C505 / C505C
1997-08-01
Related parts for C505_9708
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Watts 28volts 200-450
Manufacturer:
ETC-unknow
Datasheet:
Part Number:
Description:
50 WATTS - 28VOLTS 200-450 MHZ
Manufacturer:
ETC [List of Unclassifed Manufacturers]
Datasheet:
Part Number:
Description:
Intel 80C32 - Siemens SAB-C501, Nearest Equivalent Replacement
Manufacturer:
Siemens Semiconductor Group
Part Number:
Description:
HiRel Silicon Schottky Diode (HiRel Discrete and Microwave Semiconductor Medium barrier diodes for detector and mixer applications)
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
Part Number:
Description:
HiRel Silicon PIN Diode (HiRel Discrete and Microwave Semiconductor Current controlled RF resistor for RF attenuators and switches)
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
Part Number:
Description:
HiRel Silicon PIN Diode (HiRel Discrete and Microwave Semiconductor Current controlled RF resistor for RF attenuators and switches)
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
Part Number:
Description:
GaAs-Infrarot-Sendediode GaAs Infrared Emitter
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
Part Number:
Description:
GaAlAs-Infrarot-Sendediode GaAlAs Infrared Emitter
Manufacturer:
SIEMENS [Siemens Semiconductor Group]
Datasheet:
Part Number:
Description:
IGBT MODULE
Manufacturer:
Siemens Semiconductor Group
Datasheet:
Part Number:
Description:
SIMOPAC Module (Power module Single switch N channel Enhancement mode)
Manufacturer:
Siemens Semiconductor Group
Datasheet:
Part Number:
Description:
(BSMxxx) TRANSISTOR
Manufacturer:
Siemens Semiconductor Group
Datasheet:
Part Number:
Description:
SIMOPAC Module (Power module Single switch N channel Enhancement mode)
Manufacturer:
Siemens Semiconductor Group
Datasheet:
Part Number:
Description:
main ratings
Manufacturer:
Siemens Semiconductor Group
Datasheet:
Part Number:
Description:
Manufacturer:
Siemens Semiconductor Group
Datasheet: