C161U
Central Processor Unit
Preliminary Data Sheet
66
02.2000
PRELIMINARY
PRE
LI
M
INAR
Y
- E
XC
ER
PT
-
should not begin directly after the instruction disabling interrupts, as shown in the
following example:
INT_OFF:
BCLR IEN
; globally disable interrupts
I
N-1
; non-critical instruction
CRIT_1ST:
I
N
; begin of uninterruptable critical sequence
. . .
CRIT_LAST: I
N+x
; end of uninterruptable critical sequence
INT_ON:
BSET
IEN
; globally re-enable interrupts
Note: The described delay of 1 instruction also applies for enabling the interrupts system
ie. no interrupt requests are acknowledged until the instruction following the
enabling instruction.
Initialization of Port Pins
Modifications of the direction of port pins (input or output) become effective only after the
instruction following the modifying instruction. As bit instructions (BSET, BCLR) use
internal read-modify-write sequences accessing the whole port, instructions modifying
the port direction should be followed by an instruction that does not access the same port
(see example below).
WRONG:
BSET
DP3.13
; change direction of P3.13 to output
BSET
P3.5
; P3.13 is still input, the rd-mod-wr reads pin P3.13
RIGHT:
BSET
DP3.13
; change direction of P3.13 to output
NOP
; any instruction not accessing port 3
BSET
P3.5
; P3.13 is now output,
; the rd-mod-wr reads the P3.13 output latch
Changing the System Configuration
The instruction following an instruction that changes the system configuration via register
SYSCON (eg. segmentation, stack size) cannot use the new resources (eg. stack). In
these cases an instruction that does not access these resources should be inserted.
BUSCON/ADDRSEL
The instruction following an instruction that changes the properties of an external
address area cannot access operands within the new area. In these cases an instruction
that does not access this address area should be inserted. Code accesses to the new
address area should be made after an absolute branch to this area.
Note: As a rule, instructions that change external bus properties should not be executed
from the respective external memory area.