
298
CHAPTER 17 STANDBY FUNCTION
User
’
s Manual U15017EJ2V0UD
17.2 Control Registers
17.2.1 Standby control register (STBC)
The STBC is used to select the STOP mode setting and the internal system clock.
To prevent entry into standby mode due to an inadvertent program loop, STBC can only be written to with a
dedicated instruction. This dedicated instruction, MOV STBC, #byte, has a special code configuration (4 bytes), and
a write is only performed if the 3rd and 4th bytes of the operation code are mutual 1
’
s complements.
If the 3rd and 4th bytes of the operation code are not mutual 1
’
s complements, a write is not performed and an
operand error interrupt is generated. In this case, the return address saved in the stack area is the address of the
instruction that was the source of the error, and thus the address that was the source of the error can be identified
from the return address saved in the stack area.
If recovery from an operand error is simply performed by means of an RETB instruction, an endless loop will result.
As 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 MOV STBC, #byte 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 do not perform
any operation. That is, a write is not performed to the STBC, and an interrupt such as an operand error interrupt
is not generated.
STBC can be read at any time using a data transfer instruction.
RESET input sets STBC to 30H.
Figure 17-2 shows the format of STBC.