
The central processing unit (CPU)
UM0404
58/564
DocID13284 Rev 2
External memory access sequences
The effect described here will only become noticeable, when watching the external memory
access sequences on the external bus by means of a Logic Analyzer. Different pipeline
stages can simultaneously put a request on the External Bus Controller (EBC).
The sequence of instructions processed by the CPU may diverge from the sequence of the
corresponding external memory accesses performed by the EBC, due to the predefined
priority of external memory accesses.
Controlling interrupts
Software modifications (implicit or explicit) of the PSW are done in the execute phase of the
respective instructions. In order to maintain fast interrupt responses, however, the current
interrupt prioritization round does not consider these changes. For example an interrupt
request may be acknowledged after the instruction that disables interrupts via IEN or ILVL or
after the following instructions.
Time critical instruction sequences, therefore, should not begin directly after the instruction
disabling interrupts, as shown in the example.
Note:
The described delay of 1 instruction also applies for enabling the interrupts system that
means 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.
1st
Write Data
2nd
Fetch Code
3rd
Read Data
INT_OFF:
BCLR IEN
; globally disable interrupts
IN-1
; non-critical instruction
CRIT_1ST:
IN
; start of non-interruptible critical
; sequence
. . .
CRIT_LAST:
IN+x
; end of non-interruptible critical
; sequence
INT_ON:
BSET IEN
; globally re-enable interrupts
WRONG:
BSET DP3.13
; change direction of P3.13 to output
BSET P3.5
; P3.13 is still input, the read-modify-write
; reads pin P3.13
RIGHT:
BSET DP3.13
; change direction of P3.13 to output