TI中文支持网
TI专业的中文技术问题搜集分享网站

写 flash

各位大侠:我读了一个TI 的软件,是写FLASH 的,我想问的是 FCTL1 = FWKEY + ERASE + EEI 使能擦除中断的意义?没看到有中断响应程序,所以不懂设中断的意义,谢谢指点!

.void write_SegD(char value)
{
  char *Flash_ptr;                          // Flash pointer
  unsigned int i;

  Flash_ptr = (char *)0x1000;               // Initialize Flash pointer
  FCTL3 = FWKEY;                            // Clear Lock bit
  FCTL1 = FWKEY + ERASE + EEI;              // Set Erase bit, allow interrupts???????
  *Flash_ptr = 0;                           // Dummy write to erase Flash seg

  FCTL1 = FWKEY + WRT;                      // Set WRT bit for write operation

  for (i = 0; i < 64; i++)
  {
    *Flash_ptr++ = value;                   // Write value to flash
  }

  FCTL1 = FWKEY;                            // Clear WRT bit
  FCTL3 = FWKEY + LOCK;                     // Set LOCK bit
}

zhi chen:

也不知道擦除中断的向量是多少!

Fuchong Wang:

回复 zhi chen:

Enable Erase Interrupts. Setting this bit allows a segment erase to be interrupted by an interrupt request.

After the interrupt is serviced the erase cycle is resumed.

没用过其它型号,只用过G2系列,G2系列好像没有这个设置标志位,G2系列好像擦除过程中要禁止其它中断源

这里是不是用来允许其它中断?响应其它中断的时候擦除过程暂停,其它中断完成后擦除继续进行?

Young Hu:

回复 Fuchong Wang:

段擦除会被pending的中断打断,这个不是flash擦除的中断,而是其他的中断

赞(0)
未经允许不得转载:TI中文支持网 » 写 flash
分享到: 更多 (0)