1 Reply Latest reply on Apr 1, 2018 11:31 PM by prbd

    Data stored in nvsram failed in poweroff condition

    arjun_3267166

      Hi,

      I am currently working on CY14C101J1 nvSRAM ,interfaced to atmega2560. I am facing issue related to retrieve the  data from nvsram after power off and on condition.

      case: 1

      int main()

      {

          int8_t str[4] = {0xFF,0xBB,0xCC,0x55};

          int8_t rx_buffer[20];

          int8_t rx_buff[1];

         for(i=0;i<4;i++)

         {

               str[i] = 0;

         }

          EEPROM_Memory_Write(&str,4,SLAVE_WRITE_ADDR1,0x1234);

          EEPROM_Commnd_Write(SLAVE_WRITE_ADDR1 , COMMND_REG, ASENB );

          EEPROM_Commnd_Write(SLAVE_WRITE_ADDR1 , COMMND_REG, STORE);

          EEPROM_Memory_Read(SLAVE_READ_ADDR1,SLAVE_WRITE_ADDR1,&rx_buffer,4,0x1234);

          _delay_ms(8000);

      }

      here, i am able to read the data in rx_buffer as 0xFF,0xBB,0xCC,0x55 before power off condition.

       

      case: 2 But when i make the power off the board and power on ,i am not able to retrieve the same data in memory location (0x1234) .It showing some junk data . i tried the below steps to read the data.

       

          EEPROM_Commnd_Write(SLAVE_WRITE_ADDR1 , COMMND_REG, RECALL);

          _delay_ms(8000);

          EEPROM_Memory_Read(SLAVE_READ_ADDR1,SLAVE_WRITE_ADDR1,&rx_buffer,4,0x1234);

        

      please help me to find the solution to read actual data after making  power off and on condition.For your reference,find below attached files.

      *provide some pseudo code or steps to achieve?

      Reply as soon as possible.

       

      Thanks,

      Arjun