![](http://datasheet.mmic.net.cn/30000/M32170F3VFP_datasheet_2359455/M32170F3VFP_191.png)
6
6-46
32170/32174 Group User's Manual (Rev. 2.1)
6.7.1 Virtual-Flash Emulation Areas
The following shows the areas in which the virtual-flash emulation function is effective.
Using the Virtual-Flash L Bank Registers (FELBANK0–FELBANK3 for the M32170F6 or
FELBANK0–FELBANK2 for the M32170F4, M32170F3, M32174F4, and M32174F3), select an
arbitrary L bank area from 8-Kbyte L banks in the flash memory area (by setting the seven start
address bits A12–A18 of the desired L bank in the Virtual-Flash L Bank Register LBANKAD bits).
Then set the Virtual-Flash L Bank Register MODENL0–3 bits (for the M32170F6) or MODENL0–2
bits (for the M32170F4, M32170F3, M32174F4, and M32174F3) to 1. The selected L bank areas
can be replaced with 8-Kbyte blocks of the internal RAM beginning with its start address, up to four
blocks for the M32170F6 or up to three blocks for the M32170F4, M32170F3, M32174F4, and
M32174F3.
Similarly, using the Virtual-Flash S Bank Registers (FESBANK0, FESBANK1), select an arbitrary S
bank area from 4-Kbyte S banks in the flash memory (by setting the eight start address bits A12–
A19 of each desired S bank in the Virtual-Flash S Bank Register SBANKAD bits). Then set the
Virtual-Flash S Bank Register MODENS0 and MODENS1 bits to 1. The selected S bank areas can
be replaced with up to two 4-Kbyte blocks of the internal RAM beginning with address H’0080 C000
for the M32170F6 or H’0080 A000 for the M32170F4, M32170F3, M32174F4, and M32174F3.
In this way, the M32170F6 can have four 8-Kbyte blocks or L banks and two 4-Kbyte blocks or S
banks selected, for a total of up to six banks. For the M32170F4, M32170F3, M32174F4, and
M32174F3, three 8-Kbyte blocks or L banks and two 4-Kbyte blocks or S banks can be selected, for
a total of up to five banks.
Note 1: If the Virtual-Flash Emulation Enable bit is enabled while the same bank area is set in two
or more Virtual-Flash Bank Registers, the internal RAM area (8 or 4 Kbyte) to be replaced
with is selected according to the priority of Virtual-Flash Bank Registers as follows:
M32170F6
FELBANK0 > FELBANK1 > FELBANK2 > FELBANK3 > FESBANK0 > FESBANK1
M32170F4, M32170F3, M32174F4, and M32174F3
FELBANK0 > FELBANK1 > FELBANK2 > FESBANK0 > FESBANK1
Note 2: During virtual-flash emulation mode, the RAM can be accessed for read and write from the
internal RAM area and the area that has been set as a virtual-flash area.
Note 3: The internal RAM area from H’0080 C000 to H’0080 DFFF of the M32174F4 and M32174F3
cannot be used as a virtual-flash emulation area.
Note 4: When performing virtual-flash read after setting Flash Control Register 1’s Virtual-Flash
Emulation Mode bit to 1, be sure to wait for three CPU clock periods or more before
performing virtual-flash read after setting the said bit to 1.
Note 5: When performing virtual-flash read after setting the Virtual-Flash Bank Register (L Bank or
S Bank Register)’s Virtual-Flash Emulation Enable bit and bank address bits, be sure to
wait for three CPU clock periods or more before performing virtual-flash read after setting
the Virtual-Flash Bank Register.
INTERNAL MEMORY
6.7 Virtual Flash Emulation Function