English
Language : 

C8051F850-C-GM Datasheet, PDF (67/328 Pages) Silicon Laboratories – Low-Cost 8-bit MCU Family with up to 8 kB of Flash
10. Flash Memory
On-chip, re-programmable flash memory is included for program code and non-volatile data storage. The
flash memory is organized in 512-byte pages. It can be erased and written through the C2 interface or from
firmware by overloading the MOVX instruction. Any individual byte in flash memory must only be written
once between page erase operations.
10.1. 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 interface.
A Security Lock Byte located in flash user space offers protection of the flash program memory from
access (reads, writes, or erases) by unprotected code or the C2 interface. See Section “8. Memory
Organization” on page 49 for the location of the security byte. 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 unlocked when no other flash pages are locked (all bits of the Lock Byte are
‘1’) and locked when any other flash pages are locked (any bit of the Lock Byte is ‘0’). An example is
shown in Figure 10.1.
Security Lock Byte:
1s Complement:
Flash pages locked:
11111101b
00000010b
3 (First two flash pages + Lock Byte Page)
Figure 10.1. Security Byte Decoding
The level of flash security depends on the flash access method. The three flash access methods that can
be restricted are reads, writes, and erases from the C2 debug interface, user firmware executing on
unlocked pages, and user firmware executing on locked pages. Table 10.1 summarizes the flash security
features of the C8051F85x/86x devices.
Table 10.1. Flash Security Summary
Action
Read, Write or Erase unlocked pages
(except page with Lock Byte)
Read, Write or Erase locked pages
(except page with Lock Byte)
Read or Write page containing Lock Byte
(if no pages are locked)
Read or Write page containing Lock Byte
(if any page is locked)
C2 Debug
Interface
Permitted
User Firmware executing from:
an unlocked page a locked page
Permitted
Permitted
Not Permitted Flash Error Reset
Permitted
Permitted
Permitted
N/A
Not Permitted Flash Error Reset
Permitted
Rev. 1.0
57