English
Language : 

UPD784938 Datasheet, PDF (639/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 25 STANDBY FUNCTION
25.2 Control Registers
25.2.1 Standby control register (STBC)
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 complements of 1.
If the 3rd and 4th bytes of the operation code are not mutual complements of 1, 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 STBC, and an interrupt such as an operand error interrupt is not generated.
STBC can be read at any time by a data transfer instruction.
RESET input sets STBC to 30H.
The format of STBC is shown in Figure 25-3.
Caution Be sure to use a program that executes a NOP instruction three times to set the standby mode.
Example
MOV STBC, #byte; Sets standby mode
NOP
NOP
NOP
Preliminary User’s Manual U13987EJ1V0UM00
639