Internal Ram; I/O Ports (Addresses 00C0 To 00Cd ); Fig. 2.3.6 I/O Setting Example Of Port - Renesas 7200 Series User Manual

Mitsubishi 8-bit single-chip microcomputer
Table of Contents

Advertisement

FUNCTIONAL DESCRIPTION
2.3 Memory assignment

2.3.1 Internal RAM

The static RAM is assigned.
The internal RAM is used as a stack area for subroutine calls and interrupts as well as for storing data.
Both zero page and page 1 are used as a stack area. At reset, the page 1 is specified automatically.
Ordinary, the stack pointer is set to the highest address in the internal RAM of the page 1 during initialization
immediately after power on.
This stack pointer moves to lower addresses as the nesting depth increases; therefore, make sure the
subroutine nesting and interrupt levels to prevent the stored data destroying necessary data in the RAM.
When the stack page is specified "1," if the value of stack pointer exceeds address 0100
stack page never change to "0" automatically. In this case, set the stack page value to "0" and set the stack
pointer value to the highest address by software.
2.3.2 I/O ports (addresses 00C0
Addresses 00C0
to 00CD
16
control register. There are 5 ports: P0, P1, P2, P3 and P5. Ports P0, P1 and P2 are the 8-bit programmable
I/O ports. Port P3 consists of 5 bits. The low-order 3 bits (P3
the high-order 2 bits (P3
For I/O ports P0, P1, P2 and P3
values to each port direction register.
To specify port bits as output pins, write "1" to the corresponding bit of the port direction register.
Conversely, write "0" to the corresponding bit to specify as an input pin.
For example, to use the even numbered bits of port P2 as output ports and the odd numbered bits as input
ports, write "55
(01010101
16
Although Port P5 is an output port, it can be specified as the CRT output pins (R, G, B, OUT1) or as
general-purpose port (P5
When setting "0," it is used for the CRT output pins (R, G, B, OUT1), and when setting "1," it is used as
general-purpose output ports (P5
Note: Each port direction register default is "input" (port P5 is "CRT output") immediately after reset
release.
00C4
16
00C5
Port P2 direction register
16

Fig. 2.3.6 I/O setting example of port

2-16
to 00CD
16
16
are assigned to the ports, port direction registers and the port P3 output mode
16
and P3
) are the input ports.
3
4
–P3
, input or output can be specified in bit units by setting the relevant
0
2
)" to address 00C5
2
–P5
) by setting each bit in the port P5 direction register.
2
5
–P5
).
2
5
Port P2
7220 Group User's Manual
)
–P3
) are the programmable I/O ports, and
0
2
(the port P2 direction register) at initialization.
16
Write "55
" to port P2 direction register
16
Port P2 direction register
0 1 0 1 0 1 0 1
7
6
5
7
6
5
16
4
3
2
1
0
Bit
Port P2
4
3
2
1
0
Bit
, the value of

Advertisement

Table of Contents
loading

This manual is also suitable for:

7220

Table of Contents