MC9SHZ128的128kb的内存是怎么分配的?DATASHEET上只写了256的分为两个BLOCK,一个block有8个page,但不清楚128的也是分两个块,一个块4PAGE吗?MEMSIZ1寄存器的后三位指示的是FALSH的大小,我在AN3275里找到的这段程序
uint8 near ui8fnFindFlashPagesPerBlock(void)
{
uint8 li8BlockSearch = 0x08;
uint8 li8FlashPagesPerBlock = 0x08;
li8FlashPagesPerBlock <<= (MEMSIZ1 & 0x03);
while (--li8BlockSearch)
{
FCNFG = li8BlockSearch;
if (FCNFG == li8BlockSearch)
{
break;
}
}
li8FlashPagesPerBlock = (uint8)(li8FlashPagesPerBlock / (li8BlockSearch + 1));
return (li8FlashPagesPerBlock);
}
好像挺有意思的,请指教? |