How to write data in Flash data memory?

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

Parents
  • Dear Sir,

    I had read the datasheet and according to that only i wrote one simple program to store the bytes in one page.Here I am sending the function statements to write the bytes in data memory.

    void Flash_Mem_Write_Page(void)
    { EADRH=0x00; //Select Address hoiher byte
    EADRL=0x01; //Select addres lower byte

    EDATA1=0x12; //writing the data
    EDATA2=0x13;
    EDATA3=0x14;
    EDATA4=0x15;

    ECON=0x02; //writing the bytes
    Sleep(40);
    ECON=0x04; //verifying
    Sleep(22);

    if(!ECON) //match is there it will return 0in ECON
    printf("WRITE\n");
    else
    printf("NOT WRITE\n");
    }

    Thank you very much for replying.

Reply
  • Dear Sir,

    I had read the datasheet and according to that only i wrote one simple program to store the bytes in one page.Here I am sending the function statements to write the bytes in data memory.

    void Flash_Mem_Write_Page(void)
    { EADRH=0x00; //Select Address hoiher byte
    EADRL=0x01; //Select addres lower byte

    EDATA1=0x12; //writing the data
    EDATA2=0x13;
    EDATA3=0x14;
    EDATA4=0x15;

    ECON=0x02; //writing the bytes
    Sleep(40);
    ECON=0x04; //verifying
    Sleep(22);

    if(!ECON) //match is there it will return 0in ECON
    printf("WRITE\n");
    else
    printf("NOT WRITE\n");
    }

    Thank you very much for replying.

Children
More questions in this forum