I want to use data flash in s12xs128
void Dflash_Wt(uint paddr,unsigned dat){ while(FSTAT_CCIF == 0); //Waiting Complete FSTAT = 0X30; //Clear ACC PVI FCCOBIX = 0; //step 0 FCCOBHI = 0X11; //0X11 FCCOBLO = 0x10; //D-FLASH block address FCCOBIX = 1; //step 1 FCCOB = paddr; //Global Address Of Word To Be Program FCCOBIX = 2; //step 2 FCCOB = dat; //Word 0 program value FSTAT |=0X80; //lunch command while(FSTAT_CCIF == 0); //Waiting Complete}paddr = 0;
dat = 0x55;
after functoning this program , the the word 0x55 can't be written , I look the address 0x100000 ,but it is empty. I don't know which part of the code is wrong?
thanks!