Dear Sir,
I am using ADUC841 microcontroller from Analog devices,which consists of 8052 core.In this it is having 4Kbytes of Flash data memory.I wrote the routines as mentioned in application note for writing the data in Flash.But the data is not storing in Flash.So,please send me some guidelines for writing the data in Flash.
Thanking you,
Yours sincerely, Shivakumar Manda
Look at followed example. It works on ADuC847.
// **************************************************** // save 4 bytes to addr 0x3FF // **************************************************** void SaveSetPointToFlash(unsigned char* puc) { EA = 0; // Disable interrupts before saving EADRH = 0x03; // High byte of page Address EADRL = 0xFF; // Low byte of page Address EDATA1 = puc[0]; // Data to flash EDATA2 = puc[1]; // Data to flash EDATA3 = puc[2]; // Data to flash EDATA4 = puc[3]; // Data to flash ECON = 0x05; // Erase Page ECON = 0x02; // Write Page ECON = 0x04; // Verify Page EA = 1; // enable interrupts after saving }
As notes Christoph you should provide erasing page and remove delays.