NEC PD703114 User Manual page 625

V850e/ia2 32-bit single-chip microcontrollers
Table of Contents

Advertisement

Setting data to the flash programming mode control register (FLPMC) is performed in the following sequence.
<1> Disable interrupts (set the NP bit and ID bit of the PSW to 1).
<2> Prepare the data to be set in the specific register in a general-purpose register.
<3> Write data to the peripheral command register (PHCMD).
<4> Set the flash programming mode control register (FLPMC) by executing the following instructions.
• Store instruction (ST/SST instructions)
• Bit manipulation instruction (SET1/CLR1/NOT1 instructions)
<5> Insert NOP instructions (5 instructions (<5> to <9>)).
<10> Cancel the interrupt disabled state (reset the NP bit of the PSW to 0).
[Description example]
<1> LDSR
<2> MOV
<3> ST.B
<4> ST.B
<5> NOP
<6> NOP
<7> NOP
<8> NOP
<9> NOP
<10> LDSR
Remark
rX: Value written to the PSW
rY: Value returned to the PSW
No special sequence is required for reading a specific register.
Cautions 1. If an interrupt is acknowledged between when PHCMD is issued (<3>) and writing to a
specific register (<4>) immediately after issuing PHCMD, writing to the specific register may
not be performed and a protection error may occur (the PRERR bit of the PHS register = 1).
Therefore, set the NP bit of the PSW to 1 (<1>) to disable interrupt acknowledgment.
Similarly, disable acknowledgment of interrupts when a bit manipulation instruction is used
to set a specific register.
2. Use the same general-purpose register used to set a specific register (<3>) for writing to the
PHCMD register (<4>) even though the data written to the PHCMD register is dummy data.
This is the same as when a general-purpose register is used for addressing.
3. Before executing this processing, complete all DMA transfer operations.
CHAPTER 15 FLASH MEMORY (
rX, 5
0x02, r10
r10, PHCMD[r0]
r10, FLPMC[r0]
rY, 5
User's Manual U15195EJ5V0UD
µ
PD70F3114)
625

Advertisement

Table of Contents
loading

Table of Contents