| Electronic Components Datasheet Search |
|
C8051F360 Datasheet(PDF) 136 Page - Silicon Laboratories |
|
|
|||||||||||||||||||||||||||||
C8051F360 Datasheet(HTML) 136 Page - Silicon Laboratories |
|
136 / 288 page ![]() C8051F360/1/2/3/4/5/6/7/8/9 136 Rev. 1.0 erases will be disabled until the next system reset. Flash writes and erases will also be disabled if a Flash write or erase is attempted before the key codes have been written properly. The Flash lock resets after each write or erase; the key codes must be written again before a following Flash operation can be per- formed. The FLKEY register is detailed in SFR Definition 13.2. 13.1.2. Erasing Flash Pages From Software The Flash memory can be programmed by software using the MOVX write instruction with the address and data byte to be programmed provided as normal operands. Before writing to Flash memory using MOVX, Flash write operations must be enabled by: (1) the PSWE and PSEE bits must be set to ‘1’ (this directs the MOVX writes to target Flash memory); and (2) Writing the Flash key codes in sequence to the Flash Lock register (FLKEY). The PSWE bit remains set until cleared by software. A write to Flash memory can clear bits to logic ‘0’ but cannot set them; only an erase operation can set bits to logic ‘1’ in Flash. A byte location to be programmed should be erased before a new value is writ- ten. The Flash memory is organized in 1024-byte pages. The erase operation applies to an entire page (setting all bytes in the page to 0xFF). To erase an entire 1024-byte page, perform the following steps: Step 1. Disable interrupts (recommended). Step 2. Write the first key code to FLKEY: 0xA5. Step 3. Write the second key code to FLKEY: 0xF1. Step 4. Set PSEE (PSCTL.1) to enable Flash erases. Step 5. Set PSWE (PSCTL.0) to redirect MOVX commands to write to Flash. Step 6. Use the MOVX instruction to write a data byte to any location within the page to be erased. Step 7. Clear PSEE to disable Flash erases. Step 8. Clear the PSWE bit to redirect MOVX commands to the XRAM data space. Step 9. Re-enable interrupts. 13.1.3. Writing Flash Memory From Software Bytes in Flash memory can be written one byte at a time, or in small blocks. The CHBLKW bit in register CCH0CN (SFR Definition 14.1) controls whether a single byte or a block of bytes is written to Flash during a write operation. When CHBLKW is cleared to ‘0’, the Flash will be written one byte at a time. When CHBLKW is set to ‘1’, the Flash will be written in blocks of four bytes for addresses in code space. Block writes are performed in the same amount of time as single byte writes, which can save time when storing large amounts of data to Flash memory. For single-byte writes to Flash, bytes are written individually, and the Flash write is performed after each MOVX write instruction. The recommended procedure for writing Flash in single bytes is as follows: Step 1. Disable interrupts. Step 2. Clear CHBLKW (register CCH0CN) to select single-byte write mode. Step 3. Write the first key code to FLKEY: 0xA5. Step 4. Write the second key code to FLKEY: 0xF1. Step 5. Set PSWE (register PSCTL) to redirect MOVX commands to write to Flash. Step 6. Clear the PSEE bit (register PSCTL). Step 7. Use the MOVX instruction to write a data byte to the desired location (repeat as necessary). Step 8. Clear the PSWE bit to redirect MOVX commands to the XRAM data space. Step 9. Re-enable interrupts. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |