English
Language : 

UPD784938 Datasheet, PDF (601/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 23 INTERRUPT FUNCTIONS
(10) When an interrupt related register is polled using a BF instruction, etc., the branch destination of that BR instruction,
etc., should not be that instruction. If a program is written in which a branch is made to that instruction itself, all
interrupts and macro service requests will be held pending until a condition whereby a branch is not made by that
instruction arises.
Bad Example
LOOP: BF PIC0.7, $LOOP
×××
All interrupts and macro service requests are held pending until PIC0.7 is 1.
← Interrupts and macro service requests are not serviced until after execution
of the instruction following the BF instruction.
Good Example (1)
LOOP: NOP
BF PIC0.7, $LOOP
← Interrupts and macro service requests are serviced after execution of the
NOP instruction, so that interrupts are never held pending for a long period.
Good Example (2)
LOOP: BT PIC0.7, $NEXT
BR $LOOP
NEXT:
Using a BTCLR instruction instead of a BT instruction has the advantage
that the flag is cleared (to 0) automatically.
← Interrupts and macro service requests are serviced after execution of the
BR instruction, so that interrupts are never held pending for a long period.
(11) For a similar reason to that given in (10), if problems are caused by a long pending period for interrupts and macro
service when instructions to which the above applies are used in succession, a time at which interrupts and macro
service requests can be acknowledged should be provided by inserting an NOP instruction, etc., in the series of
instructions.
Preliminary User’s Manual U13987EJ1V0UM00
601