Specifications
C8051F330/1
Rev. 1.1 99
11.2. Non-volatile Data Storage
The FLASH memory can be used for non-volatile data storage as well as program code. This allows data such as cal-
ibration coefficients to be calculated and stored at run time. Data is written using the MOVX write instruction and
read using the MOVC instruction. Note: MOVX read instructions always target XRAM.
11.3. Security Options
The CIP-51 provides security options to protect the FLASH memory from inadvertent modification by software as
well as to prevent the viewing of proprietary program code and constants. The Program Store Write Enable (bit
PSWE in register PSCTL) and the Program Store Erase Enable (bit PSEE in register PSCTL) bits protect the FLASH
memory from accidental modification by software. PSWE must be explicitly set to ‘1’ before software can modify
the FLASH memory; both PSWE and PSEE must be set to ‘1’ before software can erase FLASH memory. Additional
security features prevent proprietary program code and data constants from being read or altered across the C2 inter
-
face.
A Security Lock Byte located at the last byte of FLASH user space offers protection of the FLASH program memory
from access (reads, writes, or erases) by unprotected code or the C2 interface. The FLASH security mechanism
allows the user to lock n
512-byte FLASH pages, starting at page 0 (addresses 0x0000 to 0x01FF), where n is the 1’s
complement number represented by the Security Lock Byte. Note that the page containing the FLASH Security Lock
Byte is locked when any other FLASH pages are locked. See example below.
Important Notes About the FLASH Security:
1. Clearing any bit of the Lock Byte to ‘0’ will lock the FLASH page containing the Lock Byte (in addi-
tion to the selected pages).
2. Locked pages cannot be read, written, or erased via the C2 interface.
3. Locked pages cannot be read, written, or erased by user firmware executing from unlocked memory
space.
4. User firmware executing in a locked page may read and write FLASH memory in any locked or
unlocked page excluding the reserved area.
5. User firmware executing in a locked page may erase FLASH memory in any locked or unlocked page
excluding the reserved area and the page containing the Lock Byte.
6. Locked pages can only be unlocked by a C2 Device Erase command.
7. If a user firmware FLASH access attempt is denied (per restrictions #3, #4, and #5 above), a FLASH
Error system reset will be generated.
Security Lock Byte: 11111101b
1’s Complement: 00000010b
FLASH pages locked: 3 (First two FLASH pages + Lock Byte Page)
Addresses locked:
0x0000 to 0x03FF (first two FLASH pages) and
0x1C00 to 0x1DFF (Lock Byte Page)