
A96G166/A96A166/A96S166 User’s manual
19. Memory programming
193
11.
Repeat
2
to 8 until all pages are erased
Flash bulk erase mode
1.
Enable program mode.
2.
Reset page buffer. FEMR: 1000_0001 FECR:0000_0010
3.
Select page buffer. FEMR:1000_1001
4.
Write ‘h00 to page
buffer. (Data value is not important.)
5.
Set erase mode. FEMR:1001_0001.
Only main cell area is erased.
For bulk erase including OTP area, select OTP area (set FEMR to 1000_1101).
6.
Set FETCR
7.
Start bulk erase. FECR:1000_1011
8.
Insert one NOP operation
9.
Read FESR until PEVBSY is 1.
Flash OTP area read mode
1.
Enter OCD (=ISP) mode.
2.
Set ENBDM bit of BCR.
3.
Enable debug and Request debug mode.
4.
Select OTP area. FEMR:1000_0101
5.
Read data from Flash.
Flash OTP area write mode
1.
Enable program mode.
2.
Reset page buffer. FEMR: 1000_0001 FECR:0000_0010
3.
Select page buffer. FEMR:1000_1001
4.
Write data to page buffer (Address automatically increases by twin).
5.
Set write mode and select OTP area. FEMR:1010_0101
6.
Set page address. FEARH:FEARM:FEARL=20’hx_xxxx
7.
Set FETCR.