English
Language : 

C515C_9711 Datasheet, PDF (66/268 Pages) Siemens Semiconductor Group – 8-Bit CMOS Microcontroller
On-Chip Peripheral Components
C515C
6.1.1.1 Port Structure Selection
After a reset operation, the quasi-bidirectional 8051-compatible port structure is selected for all
digital I/O ports of the C515C. For selection of the bidirectional (CMOS) port 5 structure the bit
PMOD of SFR SYSCON must be set. Because each port 5 pin can be programmed as an input or
an output, additionally, after the selection of the bidirectional mode, the direction register DIR5 of
port 5 must be written . This direction register is mapped to the port 5 register. This means, the port
register address is equal to its direction register address. Figure 6-2 illustrates the port- and
direction register configuration of port 5.
Int. Bus, Bit 7
Write to IP 1
D
Q
PDIR
R
Q
Enable
Delay:
2.5 Machine Cycles
Write to Port
Port Register
Internal
Bus
Enable
Instruction sequence for the programming of the direction registers:
ORL IP1, #80H ; Set bit PDIR
MOV DIRx, #OYYH ; Write port x direction register with value YYH
Direction Register
Read Port
MCS02649
Figure 6-2
Port 5 Register, Direction Register
For the access the direction register a double instruction sequence must be executed. The first
instruction has to set bit PDIR in SFR IP1. Thereafter, a second instruction can read or write the
direction registers. PDIR will automatically be cleared after the second machine cycle (S2P2) after
having been set. For this time, the access to the direction register is enabled and the register can
be read or written. Further, the double instruction sequence as shown in figure 6-2, cannot be
interrupted by an interrupt,
When the bidirectional port structure is activated (PMOD=1) after a reset, the ports are defined as
inputs (direction registers default values after reset are set to FFH).
With PMOD = 0 (quasi-bidirectional port structure selected), any access to the direction registers
has no effect on the port driver circuitries.
Semiconductor Group
6-3
1997-11-01