Take a look here: Fast! SPI 23LC1024 RAM-Bank+Photos+Code (Was: SPI EEPROM speeds better?) - Storage - Arduino Forum
I wouldn't use the chips as staple, that was my first idea as well; look in the thread linked above, there are photos especially in the last post showing the bus system on the back of my PCB. For 5 chips I already use a 74HCT138 3:8 demuxer (had to save pins on the µC - in the end I've still too little left and changed to a bigger STM32F0 / STM32F103, the last ones are very cheap available on eBay for ~6 Euros/8 USD). As I reworked my RAM bank a little, I had 2 outputs left over (one has to be spare in my project for the SPI chip deselect function) that I attached to the SPI bus and Vcc/GND/CS. Now I can add other SPI devices like an SD/Micro-SD-card shield for finally writing the captured data away more permanently.
The speed is quite constant. 5ms per measurement is close to eternity! No need for optimizing the code much. Anyhow, switching to the next chip takes at least 4 additional byte writes, if you prepare the chips for sequential mode before starting the writing. I'm doing that on another µC platform currently (pseudo-code):
for (i=0; i<5;i++){
chip_select(i);
spi_send (write mode register);
spi_send (sequential mode);
chip_deselect();
}
address=0;
int chip=0;
while (measurement) {
if (address % 0x1FFFF == 0) {
chip=(address / 0x1FFFF); // ram size 0x1FFFF=128kByte
chip_select(i);
spi_send(WRITE);
spi_send(0>>16); // MSB
spi_send(0>>8); // middle address byte
spi_send(0); // LSB
}
for (int i=0; i<0x20000; i++) {
x=read_stuff();
spi_send(x);
address++;
}
if (address==(5*0x1FFFF)) measurement=false;
}
Hope that helps!
P.S.: fat16lib, are there 256kByte FRAM chips publically available? That sounds very interesting! Edit: Nevermind, just found the thread about the prototype.