Unable to turn off SRAM 23LC1024 connected to Arduino I'm trying to reset SRAM 23LC1024 (Turn it off and turn it on again) connected to my Arduino Mega 2560. I need to do that because I want to profile the SRAM in an attempt to implement PUF. Currently, I'm able to read and write to SRAM. 

I try to cut off the ground connected to SRAM, disable the SPI, but the memory in SRAM is not back to random value (initial value of SRAM if you reset it correctly). To disconnect or connect the ground with SRAM, I used MOSFET. Before cut off the ground, I write 1's to all memory. But, after wait for seconds (or minutes), the value still the same. 

Now, the only way to reset the SRAM that I know is by resetting the Arduino itself. Can someone help me?

Below is my code

#include &lt;SPI.h&gt;

//SRAM opcodes

#define RDSR        5
#define WRSR        1
#define READ        3
#define WRITE       2

byte cs_pin = 10; //cs_pin location of the two SRAMS

//uint32_t maxram = 131072; //number of bytes in 23LC1024 SRAM
uint32_t maxpage = 4096;  //number of pages in 23LC1024 SRAM
//uint32_t maxpage = 1024;  //number of pages in 23K256 SRAM

/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-*/
//Page transfer Functions
//here we can read and write 32 bytes at each address

void Spi23LC1024Read32(uint32_t address, uint8_t cs_pin, uint8_t* buff)
{
  uint32_t i; 
  uint8_t read_page; 

  digitalWrite(cs_pin, LOW);  
  SPI.transfer(READ);
  SPI.transfer((uint8_t)(address &gt;&gt; 16));
  SPI.transfer((uint8_t)(address &gt;&gt; 8)); 
  SPI.transfer((uint8_t)address);

  for (i = 0; i &lt; 32; i++)
  {
      read_page = SPI.transfer(0x00);
      buff[i] = read_page;
  }
  digitalWrite(cs_pin, HIGH);   
}

void Spi23LC1024Write32(uint32_t address, uint8_t buffer170, uint8_t cs_pin)
{
    uint32_t i;

    digitalWrite(cs_pin, LOW); 
    SPI.transfer(WRITE);
    SPI.transfer((uint8_t)(address &gt;&gt; 16));
    SPI.transfer((uint8_t)(address &gt;&gt; 8));
    SPI.transfer((uint8_t)address);

    for (i = 0; i &lt; 32; i++)
    {
        SPI.transfer(buffer170);
    }
    digitalWrite(cs_pin, HIGH); 
}
/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-*/

uint32_t i, j, n; 
uint32_t value; 
uint32_t num = 0; 
uint32_t total_send = 10; 
uint8_t buff[32];
uint32_t index = 0;
uint8_t total_buff[32*128];
int inByte;

int pin_hold = 11;
int pin_select = 10;
int pin_mosfet = 12;

void readSRAM(){
  SPI.begin();
  digitalWrite(pin_select, LOW);
  digitalWrite(pin_hold, HIGH);
  digitalWrite(pin_mosfet, HIGH);
  delay(100);

// read
  for (j = 0; j &lt; maxpage/128; j++){
    index = 0;
    for (i = 0; i &lt; 128; i++) 
    {
      Spi23LC1024Read32(j*128+i, cs_pin,buff);
      memcpy(&amp;total_buff[index], buff, sizeof(buff));
      index += 32;
    }

    for (i = 0; i&lt; index; i++){
      Serial.println(total_buff[i], HEX);
    }
  }

   digitalWrite(pin_select, HIGH);
  digitalWrite(pin_hold, HIGH);
  digitalWrite(pin_mosfet, LOW);

  SPI.end();
}

void writeSRAM(){
  SPI.begin();
  digitalWrite(pin_select, LOW);
  digitalWrite(pin_hold, HIGH);
  digitalWrite(pin_mosfet, HIGH);
  delay(100);

// write
  for (j = 0; j &lt; maxpage/128; j++){
    index = 0;
    for (i = 0; i &lt; 128; i++) 
    {
      Spi23LC1024Write32(j*128+i, (uint8_t) 0, cs_pin);
    }
  }

  digitalWrite(pin_select, HIGH);
  digitalWrite(pin_hold, HIGH);
  digitalWrite(pin_mosfet, LOW);

  SPI.end();
}

void set(){
  Serial.begin(115200);

  delay(100);

  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(pin_select, OUTPUT);
  pinMode(pin_hold, OUTPUT);
  pinMode(pin_mosfet, OUTPUT);
}

void setup(void) 
{
  set();

  readSRAM();

  writeSRAM();
}

void loop() 
{
}
As an experiment I would make sure ALL the pins are at 0V for reset. Power on ANY pin with a return path may provide enough parasitic power to prevent a proper shutdown. 

As has been pointed out you can use a I/O pin to power the device. This SRAM has 10mA operating current; enough to be supplied by an I/O pin. Then, with code only, you can make sure all pins go to 0V for the reset. This will also give you an extra power saving mode for free.