单片机 MSP430G2553 FLASH 操作
//FLASH操作 写入 void write_SegC ( char value [ ] , char lenChar ) { char * Flash_ptr ; // Flash pointer char i ; Flash_ptr = ( char * ) 0x1040 ; // 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 < lenChar ; i ++ ) { * Flash_ptr ++ = value [ i ] ; // Write value to flash } FCTL1 = FWKEY ; // Clear WRT bit FCTL3 = FWKEY + LOCK ; // Set LOCK bit } //FLASH操作 读取 void read_SegC ( char value [ ] , char lenChar ) { char *