Thank u IanP...........
Thank u for answering...........
it has some problem...........
After writing 64 bytes u told to do the dummy write operation at the location FFFFh..
Actually in the 64 byte program operation for every byte writing i need to have high to low transition on the chip enable pin....................................
i want to try like this:
i will connect any bit of port1(here iam using p1.1) to the chip enable pin, in that pin i will send the corresponding signals (high to low(1 to 0)) on that pin in the writing process.
iam giving my idea like this in the code......
flash progarm function:
void flash_prog(unsigned char xdata *addr, unsigned char *value)
{
addr=addr;
flash_cmd(0xA0);
flash_wr(addr, value);
while (flash_rd(addr) != value[0]);
}
void flash_cmd(unsigned char cmd)
{
unsigned char xdata *ad1;
unsigned char xdata *ad2;
ad1=0x5555;
ad2=0x2AAA;
*ad1=0xAA;
*ad2=0x55;
*ad1=cmd;
}
void flash_wr(unsigned char xdata *addr, unsigned char *val)
{
int i;
P1.1=1;
for(i=0;i<64;i++)
{
P1.1=0;
*(addr++) = val;
P1.1=1
}
}
unsigned char flash_rd(unsigned char xdata *addr)
{
return *addr;
}
whenever i want to program i want to send the control command as in the datasheet , so,first control command no problem,,,, in the flash_wr(addr,data)
whenever i want to write first iam making p1.1=1 and then before writing iam making p1.1=0; so, that high -to-low transition occurs for writing and then making p1.1 =1 high for next write. in between i have add delay ,..........
i will add afterwards , this is the way iam trying....................................
whether it is feasible or not i don't know..........