2 Replies Latest reply on Dec 7, 2018 2:16 PM by BushraH_91

    Write Buffer Program implementation

      Hi,

      im trying to implement the Write Buffer Program  on S29GL064S70BHI040 and its not working and i dont know why.

      this is the code:

       

             0x105555 = 0x00AA; // enter Write To Buffer program mode  - First Cycles
             0x102AAA = 0x0055; //- Second Cycles
              0x2B8000 = 0x0025; // - Third Cycles

              0x2B8000 = (WC-1); //number of word minus 1 - Fourth Cycles
             0x2B8000 = PD[0]; //  Fifth Cycles

              for(i =1; i < dataLength;++i)//the -1 is because the Fifth Cycles
              {

                  0x2B8000 = DA[i]; // 0x2B8000 start addres +i evry Cycles
                  StartAddr++;
              }

              0x2B8000 = 0x029; // init Buffer to Flash

           

      s16_timer = Cntr_125;
                 do {
                    oldData = newData;
                    for (i = 0; i < 20; i++)
                       newData = i; // delay...
                    newData = *data;
                    } while( ((oldData != newData) || (newData != *data)) && (PassedTime(TEN_MSEC_ON_125, s16_timer) == 0) );
                 // Bit2 6 or 2 are toggled while Word Program is in progress, or written Data is not correct.


                 if ((Last Write Adder) == PD)
                 {
                     ans = FLASH_STATUS_SUCCESS;
                 }
                 else
                 {
                     ans = STATUS_FLASH_FAIL;;
                 }

       

      Please Help me to understand  Why.

      thenks