![Sino Wealth SH61F83 Manual Download Page 18](http://html1.mh-extra.com/html/sino-wealth/sh61f83/sh61f83_manual_1283060018.webp)
SH61F83
18
5.3.1. IDLE Mode
Two continuous instructions that set PCON.0 to ‘1’ and
set SUSLO to ‘55H’
let the SH61F83 enter IDLE mode. In IDLE
mode, the internal clock signal is gated off to the CPU only. The CPU status is preserved in its entirety: the Stack Pointer,
Program Counter, Program Status Word, Accumulator, and all other registers maintain their value during IDLE mode. The port
pins hold the latest logical states before system enter IDLE mode.
There are four ways to terminate IDLE mode and back to Normal mode.
In order to make the program execute properly,
user should add three NOPs after the instruction that put the device into IDLE mode. (If Watch-Dog Timer was disabled at
IDLE mode, then it will restart to count from the value where it was stopped when entering IDLE Mode. When the system
leaves IDLE Mode, PCON.0 and SUSLO will be cleared by hardware)
(1) Activation of any enabled interrupt will terminate the IDLE mode. (As same as standard 8051 micro controller) The interrupt
will be serviced, and following RETI the next instruction to be executed will be the one following the instruction that put the
device into IDLE mode.
(2) Port0, Port1, Port2, Port3 and Port4 can be set as a resume ports by setting
P0WK
,
P1WK
,
P1WK
,
P2WK
,
P3WK
, and
P4WK
. Any low level of enabled resume source will terminate the IDLE mode
(3) When the wake-up timer is time-out in IDLE mode, the next instruction to be executed will be the one following the
instruction that put the device into IDLE mode.
(4) Hardware reset, USB reset or Watch Dog Reset. At this time, the CPU resumes program execution from the beginning of
the whole program, which is 0000H.
Example:
IDLE2:
MOV
PORT2,
#FFH ; Initialize PORT2 resume source to be high.
MOV
P2WK,
#FFH ; Enable PORT2 resume ability.
MOV
PORT0,
#00H ; Pull low PORT0.
MOV
P0WK,
#00H ; Disable PORT0 resume ability.
ANL
PRCON, #FBH
; Disable Watch-Dog timer under idle mode.
MOV
CLRWDT, #55H ; Clear Watch-Dog Timer
ORL
PCON,
#01H ; Set IDLE mode.
MOV
SUSLO, #55H
; Enter IDLE mode.
NOP
; 3 NOP instruction (make sure program will executes properly)
NOP
NOP
MOV
CLRWDT, #55H ; Clear Watch-dog Timer