I was wondering if access speed might be the issue. I'm trying to avoid using an SD Card. Is there EEPROM that would transfer data fast enough?
Since speed is the issue, I'm trying to copy sounds from the external EEPROM to built in memory, and I'm trying this but not getting anything to print out.
//Include the Wire I2C Library
#include <Wire.h>
#include <PCM.h>
#define EEPROM_ADR 0x54
char example_string[] = "~New eeprom string";
const int eeprom_size = 500; // values saved in eeprom should never exceed 500 bytes
char eeprom_buffer[eeprom_size];
void setup()
{
//Start the I2C Library
Wire.begin();
Wire.setClock(400000);
//Start the serial port
Serial.begin(115200);
const int S = 1;
byte buffer[S];
for (long x = 0 ; x < 0x7D00 ; x++) //Read all 131,071 bytes from EERPOM
{
eeprom_buffer[x] = readEEPROM(x);
}
Serial.print(eeprom_buffer);
}
void loop()
{
}
byte readEEPROM(long eeaddress)
{
Wire.beginTransmission(EEPROM_ADR);
Wire.write((int)(eeaddress >> 8)); // MSB
Wire.write((int)(eeaddress & 0xFF)); // LSB
Wire.endTransmission();
Wire.requestFrom(EEPROM_ADR, 1);
byte rdata = 0xFF;
if (Wire.available()) rdata = Wire.read();
return rdata;
}