www
.mcu.com.cn
224
/
239
Rev.
1.00
CMS80F731x Reference Manual
25.
Flash Memory
25.1 Overview
Flash memory contains program memory (APROM/BOOT) and nonvolatile data memory (Data FLASH). The maximum
memory space of the program is 16KB, divided into 32 sectors, each containing 512B. The maximum data memory space is
1KB, which is divided into 2 sectors, each containing 512B.
The FLASH memory can be accessed by the associated special function register (SFR) to achieve IAP function, and the
program space can also be CRC checked by the special function register (SFR). The SFR registers used to access the FLASH
space are as follows:
⚫
MLOCK
⚫
MDATA
⚫
MADRL
⚫
MADRH
⚫
PCRCDL
⚫
PCRCDH
⚫
MCTRL
MLOCK registers are used to enable memory
operation, MDATA registers form a byte to hold 8 bits of data to be read/written,
MADRL/MADRH registers hold the address of the accessed MDATA unit or the address of CRC checksum, PCRCDL/PCRCDH
registers are used to maintain the running results of the program CRC, and MCTRL registers are used for memory operation
control.
The memory module interface allows the memory to be read/written/erased. The memory allows byte reads and writes, and
the write time is controlled by the on-chip timer, which ensures that the data in that address has been erased before writing new
data. The write and erase voltages are generated by an on-chip charge pump that is rated for operation within the voltage range
of the device for byte operation.
Flash memory erase operations only support sector erasure, not byte erasure. Before modifying the data for an address, it
is recommended that you save other data before erasing the current sector and finally writing the data.
The chip supports CRC checking of program space codes, which are generated using the polynomial CRC16-CCITT 'X
16
+X
12
+X
5
+1'.