2019-03-24 10:35发布
huixianfxt 发表于 2015-1-4 18:34 肯定不是只能在information memory这一部分存储!main flash也是可以的,别和你存储程序的地冲突就行了!
最多设置5个标签!
请问怎么知道程序是从哪里开始存储的呢?
详见图片
- void flash_test(void)
- {
- unsigned char i;
- Flash_ptr = (char *) 0xfe40; // Initialize Flash pointer
- FCTL1 = FWKEY + ERASE; // Set Erase bit
- FCTL3 = FWKEY; // Clear Lock bit
- *Flash_ptr = 0; // Dummy write to erase Flash segment
- FCTL1 = FWKEY + WRT; // Set WRT bit for write operation
- for (i=0; i<64; i++)
- {
- *Flash_ptr++ = i; // Write value to flash
- }
-
- FCTL1 = FWKEY; // Clear WRT bit
- FCTL3 = FWKEY + LOCK; // Set LOCK bit
- }
复制代码一周热门 更多>