SRAM TinyShield Tutorial

by Nick DiVitto July 02, 2018

SRAM TinyShield Tutorial

The SRAM Tinyshield allows you to add memory to your TinyDuino projects that can read and write at a virtually instant rate. Here's a quick tutorial on how to get started with the SRAM Tinyshield.


Materials

Hardware:

or

  • You can use a TinyZero or TinyScreen+ in place of the TinyDuino and USB TinyShield

Software: 

Pins Used:

  • 05 - SPI_CS: This signal is the SPI chip select for the SRAM.
  • 11 - MOSI: This signal is the serial SPI data out of the TinyDuino and into the SRAM.
  • 12 - MISO: This signal is the serial SPI data out of the SRAM and into the TinyDuino.
  • 13 - SCLK: This signal is the serial SPI clock out of the TinyDuino and into the SRAM.

Note: The resistor on R5 can be swapped to R6 to change the Chip Select Pin to pin 6.


    Background:

    • The SRAM TinyShield uses the Microchip 23LC1024 SRAM module
    • SRAM allows for some extra processing memory when your Arduino device is powered on
    • SRAM doesn't retain information through power cycles

    Step 1: Assembly (Hardware)

    On top of your TinyDuino processor, stack your USB and SRAM TinyShields. Plug a MicroUSB cable into the USB TinyShield, and plug it into a free USB port on your computer. Make sure the processor is switched on.


    Step 2: Software (Setup)

    First, open the Arduino IDE. If you don't have it installed, check out our TinyDuino Setup Tutorial. Download and install the SRAM library, which can be found here, or on the SRAM TinyShield product page. Under to the Sketch tab, go to Include Library>Add .ZIP Library. Find and select the SRAM library .ZIP folder in your downloads folder, and press "Open". The library should now be installed.


    Step 3: The Code!

    This example program is also in the SRAM examples tab from the library.

     Select the correct processor type (Arduino Pro or Pro-Mini, and 3.3v 8mHz if you're using the TinyDuino Processor) and Com port, then press the upload arrow. 

    Once the upload is complete, open the Serial Monitor, which is a magnifying glass icon at the top right of the Arduino window. Make sure that 9600 baud rate is selected. You should see that text is continuously being printed to the serial monitor. 

     

    This program writes a string of text to a specific memory address and then reads back the text from memory. The text that is read back is then printed to the Serial Monitor. You can play around with the program by changing the text that is written to memory, or changing the memory address that it is written to.


        Contact Us

        As always, if you have any questions or feedback, feel free to email us at info@tinycircuits.com.

        Show us what you make by tagging @TinyCircuits on instagram, twitter, or facebook so we can feature it!

        Thanks for making with us!

         

         



        Nick DiVitto
        Nick DiVitto

        Author



        Also in Learn

        TinyZero Accelerometer BMA250 Internet of Things Project with Cayenne
        TinyZero Accelerometer BMA250 Internet of Things Project with Cayenne

        by Laverena Wienclaw November 21, 2018

        In this tutorial, we will use Cayenne to capture some accelerometer readings on their nice Internet of Things dashboard

        View full article →

        TinyZero Setup Tutorial
        TinyZero Setup Tutorial

        by Laverena Wienclaw November 21, 2018

        Ready to get started with your new TinyCircuits product? This tutorial will cover basic setup of the TinyZero.

        View full article →

        Using the TinyZero Accelerometer
        Using the TinyZero Accelerometer

        by Laverena Wienclaw November 21, 2018

        This tutorial will guide you through reading values from the Accelerometer that can be populated on the TinyZero

        View full article →