CHAPTER 9 CLOCK GENERATION FUNCTION
311
User’s Manual U14359EJ4V0UM
Sample coding
<1>
ST.B
r11, PSMR [r0]
; Set PSMR register
<2>
MOV
0x02, r10
<3>
ST.B
r10, PRCMD [r0]
; Write PRCMD register
<4>
ST.B
r10, PSC [r0]
; Set PSC register
<5>
NOP
; Dummy instruction
<6>
NOP
; Dummy instruction
<7>
NOP
; Dummy instruction
<8>
NOP
; Dummy instruction
<9>
NOP
; Dummy instruction
(next instruction)
; Execution routine after software STOP mode and IDLE mode release
No special sequence is required to read the specific register.
Cautions 1. A store instruction for the command register does not acknowledge interrupts. This coding
is made on assumption that <3> and <4> above are executed by the program with
consecutive store instructions. If another instruction is set between <3> and <4>, the above
sequence may become ineffective when the interrupt is acknowledged by that instruction,
and a malfunction of the program may result.
2. Although the data written to the PRCMD register is dummy data, use the same register as
the general-purpose register used in specific register setting (<4>) for writing to the PRCMD
register (<3>). The same method should be applied when using a general-purpose register
for addressing.
3. At least 5 NOP instructions must be inserted after executing a store instruction to the PSC
register to set software STOP or IDLE mode.
4. Be sure to terminate all DMA transfers prior to the execution of the above sequence.