Datasheet

RL78/L12 CHAPTER 23 SAFETY FUNCTIONS
R01UH0330EJ0200 Rev.2.00 780
Dec 13, 2013
<Operation flow>
Figure 23-3. Flowchart of Flash Memory CRC Operation Function (High-speed CRC)
Cautions 1. The CRC operation is executed only on the code flash.
2. Store the expected CRC operation value in the area below the operation range in the code flash.
3. The CRC operation is enabled by executing the HALT instruction in the RAM area.
Be sure to execute the HALT instruction in RAM area.
The expected CRC value can be calculated by using the Integrated Development Environment CubeSuite+. See the
Integrated Development Environment CubeSuite+ user’s manual for details.
Start
; Store the expected CRC operation result
; value in the lowest 4 bytes.
; Set CRC operation range.
; Copy the HALT and RET instructions to the
; RAM to execute in the RAM.
; Initialize the 10 bytes after the RET instruction.
; Masks all interrupt
; Enable CRC operation
; Initialize the CRC operation result register
; Call the address of the HALT instruction
; copied to the RAM.
; CRC operation starts by HALT instruction
; execution
; When the CRC operation is complete, the HALT
; mode is released and control is returned from RAM
; Prohibit CRC operation
; Read CRC operation result
; Compare the value with the stored expected
; value.
Correctly complete
Abnormal complete
Set FEA5 to FEA0 bits
PGCRCL = 0000H
CRC0EN = 0
Read the value of PGCRCL.
Execute RET instruction.
All xxMKx = 1
Copy HALT and RET instructions to
RAM, initialize 10 bytes
CRC0EN = 1
Compare the value with
the expected CRC value.
Match
Not match
Execute CALL instruction
Execute HALT instruction.
CRC operation
co
m
p
l
eted
?
Yes
No
<R>