NEC V850/SB1TM User Manual page 173

32-bit single-chip microcontroller
Table of Contents

Advertisement

6.6 Notes on Power Save Function
If the V850/SB1 or V850/SB2 is used under the following conditions, the address indicated by the program counter
(PC) differs from the address that actually reads an instruction after the power save mode has been released.
Of the instructions 4 to 16 bytes after the instruction that writes data to the PSC register, the CPU may ignore 4 or
8 bytes of the instruction and execute wrong instructions.
[Conditions]
(i) If the power save mode (IDLE or STOP mode) is set while an instruction is being executed on the external ROM
(ii) If the power save mode is released by an interrupt request
(iii) If the subsequent instruction is executed while an interrupt request is being held pending after the power save
mode has been released
Conditions in which an interrupt request is held pending:
• If the NP flag of the PSW register is "1" (during NMI servicing/set by software)
• If the ID flag of the PSW register is "1" (during interrupt request servicing/DI instruction/set by software)
• If the power save mode is released by an interrupt request with a priority the same as or lower than the
interrupt request being serviced even though interrupts are enabled (EI status)
Therefore, use the V850/SB1 and V850/SB2 under the following conditions:
[Conditions]
(i) Do not use a power save mode (IDLE or STOP mode) while an instruction is being executed on the external
ROM
(ii) Take the following measures using software if a power save mode is used while an instruction is being executed
on the external ROM:
• Insert six NOP instructions 4 bytes after the instruction that writes data to the PSC register.
• Insert the br $+2 instruction to eliminate the difference in the address of the CPU after the NOP instructions.
[Example of prevention program]
ldsr
rx, 5
st.b
r0, PRCMD[r0]
st.b
rD, PSC[r0]
ldsr
rY, 5
nop
nop
nop
nop
nop
br $+2
Remark It is assumed that the following values have already been set:
rD: PSC set value, rX: Value written to PSW, rY: Value written back to PSW
CHAPTER 6
CLOCK GENERATION FUNCTION
; Sets value of rX to PSW.
; Writes data to PRCMD.
; Sets PSC register.
; Returns value of PSW.
; Six NOP instructions or more
; Eliminates difference of PC
User's Manual U13850EJ4V0UM
173

Advertisement

Table of Contents
loading

Table of Contents