欢迎访问ic37.com |
会员登录 免费注册
发布采购

C8051F363 参数 Datasheet PDF下载

C8051F363图片预览
型号: C8051F363
PDF下载: 下载PDF文件 查看货源
内容描述: 混合信号ISP功能的Flash MCU系列 [Mixed Signal ISP Flash MCU Family]
分类和应用:
文件页数/大小: 288 页 / 2659 K
品牌: SILICON [ SILICON ]
 浏览型号C8051F363的Datasheet PDF文件第132页浏览型号C8051F363的Datasheet PDF文件第133页浏览型号C8051F363的Datasheet PDF文件第134页浏览型号C8051F363的Datasheet PDF文件第135页浏览型号C8051F363的Datasheet PDF文件第137页浏览型号C8051F363的Datasheet PDF文件第138页浏览型号C8051F363的Datasheet PDF文件第139页浏览型号C8051F363的Datasheet PDF文件第140页  
C8051F360/1/2/3/4/5/6/7/8/9  
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.  
136  
Rev. 1.0