|
请问高手们我用的是89c51F的单片机现在对用c语言来开发有问题,急等。。。
[复制链接]
在large : XDATA模式下,如何实现掉电保存,我这样写,现在已写入就死机。
void Write_Flash_address (unsigned char block,unsigned int startaddress,unsigned char *p,unsigned int len)
{
unsigned int i=0;
unsigned char SFRP_SAVE = SFRPAGE; // Save Current SFR page
pwrite = (unsigned char xdata *)(0x8000 + startaddress);
EA = 0;
SFRPAGE = 0x0f;
CCH0CN &= 0xFE; //signal Byte writing
SFRPAGE = 0x00;
PSBANK = block; //select block
PSCTL &= ~0x04;
FLSCL |= 0x11;
PSCTL |= 0x01;
for(i=0;i
{
pwrite=p;
}
PSCTL &= ~0x01;
FLSCL &= ~0x01;
EA = 1;
SFRPAGE = SFRP_SAVE; // Restore SFRPAGE
}
|
|