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

C8051F502-IM 参数 Datasheet PDF下载

C8051F502-IM图片预览
型号: C8051F502-IM
PDF下载: 下载PDF文件 查看货源
内容描述: 混合信号ISP功能的Flash MCU系列 [Mixed Signal ISP Flash MCU Family]
分类和应用: 微控制器和处理器外围集成电路PC时钟
文件页数/大小: 312 页 / 2813 K
品牌: SILICON [ SILICON ]
 浏览型号C8051F502-IM的Datasheet PDF文件第129页浏览型号C8051F502-IM的Datasheet PDF文件第130页浏览型号C8051F502-IM的Datasheet PDF文件第131页浏览型号C8051F502-IM的Datasheet PDF文件第132页浏览型号C8051F502-IM的Datasheet PDF文件第134页浏览型号C8051F502-IM的Datasheet PDF文件第135页浏览型号C8051F502-IM的Datasheet PDF文件第136页浏览型号C8051F502-IM的Datasheet PDF文件第137页  
C8051F50x-F51x  
15.4. Flash Write and Erase Guidelines  
Any system which contains routines which write or erase Flash memory from software involves some risk  
that the write or erase routines will execute unintentionally if the CPU is operating outside its specified  
operating range of VDD, system clock frequency, or temperature. This accidental execution of Flash modi-  
fying code can result in alteration of Flash memory contents causing a system failure that is only recover-  
able by re-Flashing the code in the device.  
The following guidelines are recommended for any system which contains routines which write or erase  
Flash from code.  
15.4.1. V Maintenance and the V monitor  
DD  
DD  
1. If the system power supply is subject to voltage or current "spikes," add sufficient transient protection  
devices to the power supply to ensure that the supply voltages listed in the Absolute Maximum Ratings  
table are not exceeded.  
2. The on-chip VDD monitor is turned on and enabled as a reset source by default by the hardware. If it is  
disabled by the firmware, use the following recommendations when re-enabling the VDD monitor. Turn  
on the VDD monitor and enable it as a reset source as early in code as possible. This should be the first  
set of instructions executed after the Reset Vector. For C-based systems, this will involve modifying the  
startup code added by the C compiler. See your compiler documentation for more details. Make certain  
that there are no delays in software between enabling the VDD monitor and enabling the VDD monitor as  
a reset source. Code examples showing this can be found in “AN201: Writing to Flash from Firmware",  
available from the Silicon Laboratories web site.  
3. As an added precaution, explicitly enable the VDD monitor and enable the VDD monitor as a reset  
source inside the functions that write and erase Flash memory. The VDD monitor enable instructions  
should be placed just after the instruction to set PSWE to a 1, but before the Flash write or erase  
operation instruction.  
4. Make certain that all writes to the RSTSRC (Reset Sources) register use direct assignment operators  
and explicitly DO NOT use the bit-wise operators (such as AND or OR). For example, "RSTSRC =  
0x02" is correct. "RSTSRC |= 0x02" is incorrect.  
5. Make certain that all writes to the RSTSRC register explicitly set the PORSF bit to a 1. Areas to check  
are initialization code which enables other reset sources, such as the Missing Clock Detector or  
Comparator, for example, and instructions which force a Software Reset. A global search on "RSTSRC"  
can quickly verify this.  
15.4.2. PSWE Maintenance  
1. Reduce the number of places in code where the PSWE bit (b0 in PSCTL) is set to a 1. There should be  
exactly one routine in code that sets PSWE to a 1 to write Flash bytes and one routine in code that sets  
PSWE and PSEE both to a 1 to erase Flash pages.  
2. Minimize the number of variable accesses while PSWE is set to a 1. Handle pointer address updates  
and loop variable maintenance outside the "PSWE = 1;... PSWE = 0;" area. Code examples showing  
this can be found in ”AN201: Writing to Flash from Firmware" available from the Silicon Laboratories  
web site.  
3. Disable interrupts prior to setting PSWE to a 1 and leave them disabled until after PSWE has been  
reset to '0'. Any interrupts posted during the Flash write or erase operation will be serviced in priority  
order after the Flash operation has been completed and interrupts have been re-enabled by software.  
4. Make certain that the Flash write and erase pointer variables are not located in XRAM. See your  
compiler documentation for instructions regarding how to explicitly locate variables in different memory  
areas.  
5. Add address bounds checking to the routines that write or erase Flash memory to ensure that a routine  
called with an illegal address does not result in modification of the Flash.  
Rev. 1.1  
133  
 复制成功!