TI给的关于FLASH历程
void main(void)
{
unsigned long * Flash_ptrD; // Initialize Flash pointer Seg D
unsigned long value;
WDTCTL = WDTPW+WDTHOLD; // Stop WDT
Flash_ptrD = (unsigned long *) 0x1800; // Initialize Flash pointer
value = 0x12345678; // Initialize Value
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptrD = 0; // Dummy write to erase Flash seg
FCTL1 = FWKEY+BLKWRT; // Enable long-word write
*Flash_ptrD = value; // Write to Flash
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
while(1); // Loop forever, SET BREAKPOINT HERE
}
value的值怎么那么大??一个地址也存放不下啊~~~~~~~~~~~~
此帖出自
小平头技术问答
在仿真模式下查看内存地址0x1800,试试
这个430指针不会自加一吧,会顺着往下写么?
一周热门 更多>