95
CHAPTER 4 CLOCK GENERATOR
4.2 Control Registers
4.2.1 Standby control register (STBC)
STBC is a register used to set the standby mode. Refer to
CHAPTER 18 STANDBY FUNCTION
for details of the standby
modes.
To prevent erroneous entry into standby mode due to an inadvertent program loop, the STBC register can only be written
to by a dedicated instruction. This instruction is the MOV STBC, #byte instruction, and has a special code configuration (4 bytes).
A write is only performed if the 3rd and 4th bytes of the op code are mutual complements. If the 3rd and 4th bytes of the op code
are not mutual complements, a write is not performed, and an op error interrupt is generated. In this case, the return address
saved in the stack area is the address of the instruction which is the source of the error. The error source address can thus be
found from the return address saved on the stack area.
An endless loop will result if restore from an operand error is simply performed with an RETB instruction.
Since an operand error interrupt is only generated in the event of an inadvertent program loop (with the NEC assembler
RA78K4, only the correct dedicated instruction is generated when the MOV STBC, #byte instruction is written), system
initialization should be performed by the program.
Other write instructions (“MOV STBC, A”, “AND STBC, # byte”, “SET1 STBC.7”, etc.) are ignored, and no operation is
performed. That is, a write is not performed on the STBC, and an interrupt such as an operand error interrupt is not generated.
The STBC can be read at any time with a data transfer instruction.
RESET input sets the STBC register contents to 30H.
The format of the STBC is shown in Figure 4-3.
Figure 4-3. Standby Control Register (STBC) Format
Caution
If the STOP mode is used when external clock input is used, the EXTC bit of the oscillation stabilization
time specification register (OSTS) must be set (1) before setting the STOP mode. If the STOP mode is used
when the EXTC bit of the OSTS is in the cleared (0) state when external clock input is used, the
m
PD784046
may be damaged or suffer reduced reliability.
When setting the EXTC bit to 1, be sure to input a clock in phase reverse to that of the clock input to the
X1 pin, to the X2 pin.
0
0
1
1
0
0
STP
HLT
7
6
5
4
3
2
1
0
STP
0
0
1
1
CPU Operating Mode Control
Normal mode
HALT mode
STOP mode
IDLE mode
HLT
0
1
0
1
STBC
Address : 0FFC0H On reset : 30H R/W