mini arduino (V 05) and ram 23LC1024

I have a problem with your Arduino mini 5v (V 05) and the ram 23LC1024 (http://ww1.microchip.com/downloads/en/DeviceDoc/25142A.pdf) purchased by microchip.

I managed to run arduino one with the ram 23LC1024 thanks to this article Need More Memory? Arduino and 23LC1024 | µC eXperiment.

Then I tried the ram with Arduino mini (using the same configuration used with arduino one), but I can not make it work.

I run the same program from the article

and while one with arduino printing video (monitor serial) writes me the values ??correctly, with arduino mini, almost all the values ??stored in the ram do not match the values ??stored with
for (i = 0; i <32; i) {
Spi23LC1024Write8 (i, (uint8_t) i);
value = Spi23LC1024Read8 (i);
Serial.println ((uint16_t) value);
}

I also put in the function of Serial.print

SPIClass :: byte transfer (byte _data) {
SPDR = _data;
Serial.print ("data");
Serial.println (_data);

while (! (SPSR & (1 << SPIF)))

/ / While (! (SPSR & _BV (SPIF)))
{
Serial.print ("_BV (SPIF)");
Serial.println (_BV (SPIF));

Serial.print ("SPSR");
Serial.println (SPSR);

}

Serial.print ("transfer");
Serial.println (SPDR);

return SPDR;
}

My idea is that it is a library problem or SPI clock

Does anyone have an idea?
If anyone can help I would be grateful

I also changed the part number in this way

/*
Used the following components and wire routing:
(1) Arduino Uno
(2) Microchip 23LC1024
(3) 10K Resistor
*/
#include <SPI.h>

//SRAM opcodes
#define RDSR 5
#define WRSR 1
#define READ 3
#define WRITE 2

//Byte transfer functions
uint8_t Spi23LC1024Read8(uint32_t address) {
uint8_t read_byte;

//PORTB &= ~(1<<PORTB2); //set SPI_SS low
PORTB&=~4;//cs low
Serial.println("inizio lettura");
Serial.print("portb low");
Serial.println(PORTB);
delay(20);
SPI.transfer(READ);
SPI.transfer((uint8_t)(address >> 16) & 0xff);
SPI.transfer((uint8_t)(address >> 8) & 0xff);
SPI.transfer((uint8_t)address);
read_byte = SPI.transfer(0x00);

//PORTB |= (1<<PORTB2); //set SPI_SS high
PORTB|=4;//cs high pin 10

Serial.print("portb_2 hight");
Serial.println(PORTB);
Serial.print("address lettura");
Serial.println(address);
Serial.print("read_byte ");
Serial.println(read_byte);
Serial.println("fine lettura");
return read_byte;
}

void Spi23LC1024Write8(uint32_t address, uint8_t data_byte) {
Serial.print("scrivo indirizzo ");
Serial.println(address);
Serial.print("valore ");
Serial.println(data_byte);

//PORTB &= ~(1<<PORTB2); //set SPI_SS low
PORTB&=~4;//cs low
delay(20);
SPI.transfer(2);
delay(20);
SPI.transfer((uint8_t)(address >> 16) & 0xff);
delay(20);
SPI.transfer((uint8_t)(address >> 8) & 0xff);
delay(20);
SPI.transfer((uint8_t)address);
delay(20);
SPI.transfer(data_byte);
//PORTB |= (1<<PORTB2); //set SPI_SS high
PORTB|=4;//cs high pin 10

Serial.println("fine scrittura valore");

}

void setup(void) {
/*
uint32_t k;

uint8_t value;

Serial.begin(9600);
SPI.begin();

for (k=0; k<64; k++) {
Spi23LC1024Write8(k, (uint8_t)k);
delay (20);
Serial.print("scrivo");Serial.println((uint8_t)k);
value = Spi23LC1024Read8(k);
Serial.println((uint16_t)value);
delay (20);

}
*/
}

int inizio=0;

void loop() {

delay(5000);
if (inizio==0)
{
uint32_t k;

uint8_t value;

Serial.begin(9600);
SPI.begin();

for (k=0; k<64; k++) {
Spi23LC1024Write8(k, (uint8_t)k);
delay (20);
Serial.print("scrivo");Serial.println((uint8_t)k);
value = Spi23LC1024Read8(k);
Serial.println((uint16_t)value);
delay (20);
inizio=1;
}
}
// uint8_t xxx;
//Serial.println("test");
// xxx = Spi23LC1024Read8(10);
// Serial.println(xxx);

}