English
Language : 

C8051F300_08 Datasheet, PDF (90/179 Pages) Silicon Laboratories – Mixed Signal ISP Flash MCU Family
C8051F300/1/2/3/4/5
10.1.3. Flash Write Procedure
Flash bytes are programmed by software with the following sequence:
Step 1. Disable interrupts (recommended).
Step 2. Erase the 512-byte Flash page containing the target location, as described in Section
10.1.2.
Step 3. Set the PSWE bit in PSCTL.
Step 4. Clear the PSEE bit in PSCTL.
Step 5. Write the first key code to FLKEY: 0xA5.
Step 6. Write the second key code to FLKEY: 0xF1.
Step 7. Using the MOVX instruction, write a single data byte to the desired location within the 512-
byte sector.
Steps 5–7 must be repeated for each byte to be written. After Flash writes are complete, PSWE should be
cleared so that MOVX instructions do not target program memory. Writing to and erasing the Reserved
area of Flash should be avoided.
Table 10.1. Flash Electrical Characteristics
Parameter
Conditions
Flash Size
C8051F300/1/2/3
C8051F304
C8051F305
Endurance
Erase Cycle Time
25 MHz System Clock
Write Cycle Time
25 MHz System Clock
SYSCLK Frequency (Flash
writes from application code)
*Note: 512 bytes at location 0x1E00 to 0x1FFF are reserved.
Min
8192*
4096
2048
20k
10
40
100
Typ
100k
15
55
Max
20
70
Units
bytes
bytes
bytes
Erase/Write
ms
µs
kHz
10.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 calibration coefficients to be calculated and stored at run time. Data is written using the MOVX
instruction and read using the MOVC instruction.
10.3. Security Options
The CIP-51 provides security options to protect the Flash memory from inadvertent modification by soft-
ware 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 stored at the last byte of Flash user space protects the Flash program memory from
being read or altered across the C2 interface. See Table 10.2 for the security byte description; see
Figure 10.1 for a program memory map and the security byte locations for each device.
90
Rev. 2.9