466
CHAPTER 24 STANDBY FUNCTION
User’s Manual U12697EJ3V0UM
24.2 Control Registers
(1) Standby control register (STBC)
STBC register sets the STOP mode and selects the internal system clock.
To prevent the standby mode from accidentally being entered due to an inadvertent program loop, this register
can only be written by a special instruction. This special instruction is MOV STBC, #byte which has a special
code structure (4 bytes). This register can only be written when the third and fourth byte op codes are mutual
1’s complements.
If the third and fourth byte op codes are not mutual 1’s complements, the register is not written and an operand
error interrupt is generated. In this case, the return address that is saved on the stack is the address of the
instruction that caused the error. Therefore, the address that caused the error can be determined from the return
address saved on the stack.
If the RETB instruction is used to simply return from an operand error, an infinite loop occurs.
Since an operand error interrupt is generated only when the program inadvertently loops (only the correct
instruction is generated when MOV STBC, #byte is specified in RA78K4 NEC assembler), make the program
initialize the system.
Other write instructions (i.e., MOV STBC, A; STBC, #byte; SET1 STBC.7) are ignored and nothing happens. In
other words, STBC is not written, and an interrupt, such as an operand error interrupt, is not generated.
STBC can always be read by a data transfer instruction.
RESET input sets STBC to 30H.
Figure 24-2 shows STBC format.