EasyManuals Logo

Abov MC96F6332D User Manual

Default Icon
327 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #313 background imageLoading...
Page #313 background image
MC96F6432
June 22, 2018 Ver. 2.9 313
15.1.10 Protection for Invalid Erase/Write
It should be taken care to the flash erase/write programming in code.
You must make preparations for invalid jump to the flash erase/write code by malfunction, noise, and
power off.
Note) For more information, please refer to the appendix “Flash Protection for Invalid Erase/Write”.
1. User ID check routine for the flash erase/write code.
ErWt_rtn:
---
MOV FIDR,#10100101B ;ID Code
MOV A,#ID_DATA_1 ;Ex) ID_DATA_1: 93H, ID_DATA_2: 85H, ID_DATA_3: 5AH
CJNE A,UserID1,No_WriteErase
MOV A,#ID_DATA_2
CJNE A,UserID2,No_WriteErase
MOV A,#ID_DATA_3
CJNE A,UserID3,No_WriteErase
MOV FMCR,#0x?? ;0x03 if write, 0x02 if erase
---
---
RET
No_WriteErase:
MOV FIDR,#00H
MOV UserID1,#00H
MOV UserID2,#00H
MOV UserID3,#00H
MOV Flash_flag,#00H
RET
If code is like the above lines, an invalid flash erase/write can be avoided.
NOTE) On flash memory erase and write, it should be disabled the RXE0/1 bit of USI0CR2/USI1CR2 register.
2. It is important where the UserID1/2/3 is written. It will be remain the invalid flash erase/write
problem if the UserID1/2/3 is written at the above line of the instruction “MOV
FIDR,#10100101B”. So. It had better writing the UserID1/2/3 in another routine after return.
Decide_ErWt:
---
MOV Flash_flag1,#38H ;Random value for example, in case of erase/write needs
MOV FSADRL,#20H ;Here 20H is example,
MOV Flash_flag2,#75H
RET

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Abov MC96F6332D and is the answer not in the manual?

Abov MC96F6332D Specifications

General IconGeneral
BrandAbov
ModelMC96F6332D
CategoryMicrocontrollers
LanguageEnglish

Related product manuals