Can a APS6404L be connected to Teensy 4.0 SPI and store data?

KrisKasprzak

Well-known member
All,

Before I begin this experiment, is it even possible to use the APS6404L (or any other SRAM chip) as data storage device for a Teensy 3.2 or Teensy 4.0? I see it can be soldered to a 4.1, but since according to the data sheet it's an SPI device, so maybe it can be used on the smaller chips

My usage of SD cards for data storage works fine, but always looking for alternatives. Since this chip is an SPI device, maybe I can connect it to the Teensy 4.0's SPI buss and write data to it? If it's possible, I'll look at writing a lib to make storage and retrieval easy.

questions
1. think this chip can be connected to the SPI buss and be used to store data on a 3.2/4.0?
2. will this chip retain data after power off (data sheet says yes, but not sure i'm reading it right--Pseudo is confusing me)
3. Anyone tried this before?

I don't mind buying one and playing around, but if it's not even possible, I'll spend my time on something else :)

Thanks in advance

Kris
 
OK, i tried and failed... I have a chip and connected it to my Teensy 4.0 using SPI wiring and chip select =10.

I'm using a chip: ESP-PSRAM64H, with this data sheet. https://www.espressif.com/sites/def...ion/esp-psram64_esp-psram64h_datasheet_en.pdf

I found several examples in writing to external memory that all seems to say the same thing. I have attached some code that fails to save/read data to the external memory chip.

Since others claim this is possible, granted they are using a different chip, any thoughts why this fails in my case?

Code:
/* 

data sheet https://www.espressif.com/sites/default/files/documentation/esp-psram64_esp-psram64h_datasheet_en.pdf

using with a teensy 4.0
connections:
CS pin 10
SCK pin 13
MISO pin 12
MOSI pin 11
Vcc 3v3
VSS GND

*/

#define WRITE 0x02
#define READ  0x03
#define WREN  0x66 // reset enable, not sure if this is write enable....data sheet does not state to enable write

#include <SPI.h>

uint32_t address = 4; // just pick something
byte saveval = 4; // JUST PICK SOMETHING
byte readvalue;

void setup() {
  Serial.begin(9600);
  while (!Serial) {}

  // datasheet does not specify any of this
  // here or not, code fails to write/read data
  /*
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE0);
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  */
  SPI.begin(); // sets up pin modes etc.
  delay(1000);

  // Enable writing
  // data sheet is not clear if this is even needed
  // here or not, code fails to write/read data
  //digitalWrite(SS, LOW);
  //SPI.transfer(WREN);
  //digitalWrite(SS, HIGH);

  // Write One Value to One Address
  digitalWrite(SS, LOW);
  SPI.transfer(WRITE); // write instruction
  SPI.transfer((address >> 16) & 0b11111111);
  SPI.transfer((address >> 0) & 0b11111111);
  SPI.transfer(address  & 0b11111111);
  SPI.transfer(saveval);
  digitalWrite(SS, HIGH);

  delay(1000);

  // Read One Value from One Address
  digitalWrite(SS, LOW);
  SPI.transfer(READ); // read instruction
  SPI.transfer((address >> 16) & 0b11111111);
  SPI.transfer((address >> 0) & 0b11111111);
  SPI.transfer(address  & 0b11111111);
  readvalue = SPI.transfer(0);
  Serial.print("Read Data = ");
  // recall we tried to write 4 to address 4
  // but data out is 0
  Serial.println(readvalue, DEC);

  digitalWrite(SS, HIGH);
}

void loop()
{

}
 
Back
Top