S3F84B8_UM_REV 1.00
6 INSTRUCTION SET
6-84
6.3.72 WFI — WAIT FOR INTERRUPT
WFI
Operation
:
The CPU is halted until an interrupt occurs; even though DMA transfers can still take place during
the wait state. The WFI status can be released by an internal interrupt, including a fast interrupt.
Flags
:
No flags are affected.
Format
:
Bytes Cycles
Opcode
(Hex)
opc
1
4n 3F
( n = 1, 2, 3, … )
Example
:
The following sample program structure shows the sequence of operations that follow a “WFI”
statement:
EI
WFI
(Next instruction)
Main program
.
.
.
.
.
.
Interrupt occurs
Interrupt service routine
.
.
.
Clear interrupt flag
IRET
Service routine completed
(Enable global interrupt)
(Wait for interrupt)