External SRAM (23LC1024)


This tutorial demonstrates how to connect the 23LC1024 (1MBit or 128KB SPI SRAM chip). The 23LC1024 is part of a SRAM Integrated Circuits from Microchip. The members of the family all vary with size, with regards to the SRAM, but utlise the same packaging, pin out and set of commands.

  • Rating – Easy
  • Total Cost – £3 (As usual the an Arduino and breadboard are not included)

Parts List

  • Arduino Uno
  • 23LC1024
  • Breadboard
  • Jumper Wires

Wiring Schematic


23LC1024              -> Arduino
1 CS (Chip Select) -> D10 (this can be changed to suit your needs)
2 SO (Slave Out)   -> D12 (MOSI)
3 SIO2                   -> 5V
4 Vss (Ground)      -> Ground
5 SI (Slave In)        -> D11 (MISO)
6 SCK (Clock)        -> D13 (Clock)
7 HOLD                 -> 5V
8 Vcc (Supply)       -> 5V
*Note the 23LC1024 will work with voltages from 3-5v.
**Note pullup resistors have been omitted from the
diagram but should be used on pins 3 and 7.

More information on the Chip can be found in its datasheet located here.


The first step is to download the SpiRam_Extended Library from here. This library is an extended version, which i wrote, of the original SpiRam library. It allows for easy transfer of the three most commonly used variable types (Int, Long and Float).

Next you must wire up the Arduino and 23LC1024 as shown in the wiring schematic section. The chip utilises the SPI protocol but is also capable of SDI and SQI which is why pin 3 is simply pulled high. The hold functionality allows you to pause sending data to the chip and later resume without sending new initialisation commands. For the purpose of this tutorial we are not going to be using this. If your are not using an Arduino Uno I have also included the function that the pins you are connecting to have so that you may easily remap it to the SPI pins on your board.

Open up the Arduino IDE and select the SpiRam_Extended_Functions example script. If you are not using the 23LC1024 but one of the other chips you will have to modify the following line appropriately. Additionally if you find that the chip appears to be functioning sporadically try reducing the SPI_CLOCK speed to a slower speed e.g. SPI_CLOCK_DIV16.


If you have not used pin 10 as the chip select pin you will also have to modify the following line. Note remember that you will still need to ensure pin 10 is set to output to prevent the Arduino entering slave mode.

#define SS_PIN 10

Upload the code to your Arduino. Once it has loaded open the Serial Monitor and you should see something like this:

Writing and reading int
Write Time = 716
Write Time = 416
Write and Read Successful

Writing and reading long
Write Time = 556
Read Time = 548
Write and Read Successful

Writing and reading float
Write Time = 556
Read Time = 548
Write and Read Successful

Writing and reading int array of 20
Write Time = 2948
Read Time = 2936
Write and Read Successful

Writing and reading long array of 20
Write Time = 5552
Read Time = 5544
Write and Read Successful

Writing and reading float array of 20
Write Time = 5548
Read Time = 5548
Write and Read Successful
Send any key to retest

Finally when it comes to implementing this yourself If your application requires fast storage, which if you are interested in using external SRAM it probably does, you will find that it is allot quicker to use the array writing functions to write a buffer of for example 20 values at a time than storing the individual value in 20 separate loops. The same goes for reading.

SpiRam.read_Ints(start Address,Array,Size of array);
SpiRam.read_longs(start Address,Array,Size of array);
SpiRam.read_floats(start Address,Array,Size of array);

SpiRam.write_ints(start Address,Array,Size of array);
SpiRam.write_longs(start Address,Array,Size of array);
SpiRam.write_floats(start Address,Array,Size of array);

The arrays used here are pointers to an array you defined. I.e. you must define your array of integers ready to hold the values obtained using the read_ints function.

Arduino Code

N/A – All code required can be found in the SpiRam_Extended example scripts

Processing Code

N/A – Processing was not used in this example

One thought on “External SRAM (23LC1024)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s