Hi guys,
I am working on a new gadget that is supposed to perform seismic data logging and the design is going to be based around Teensy 3.2 (I wish Teensy 3.6 with much bigger memory was out and well supported as Teensy 3.2 at this point). The board needs to be able to record snapshots of data collected for duration of 5 seconds from 6 ADC channels sampled at 4KHz. The memory requirement is about 240 KB (5sec X 6 ADC channels X 4KHz X 2 bytes per sample = 240 KBytes) of memory with fast access.
The basic program logic is once the trigger is set is to use 25us (4KHz) timer interrupt to collect data for 5 seconds and load into an array. Once 5 seconds is up transfer collected data from the array and write it on an SD card and wait for next trigger which is expected to occur once per minute so there is plenty of time to transfer data to an SD card. The problem is that Teensy 3.2 doesn’t have enough memory to hold that much data and I need some intermediate memory buffer. I am pretty sure I cannot write data to an SD card every 25us since the access times are in the millisecond range. I am thinking of using Microchip 23LC1024 SPI interface chip but that has only 1Mbit (128Kbytes of memory). I guess I might use two of them sequentially to store data.
Another option might be to use some fancy multiple interrupt routines to write to the SD card in bigger memory chunks while the 25us timer interrupt collects ADC data but I don’t have a good idea for how to do this.
Please let me know if you have any suggestions or ideas for how to best tackle this type of a problem. Both software and hardware ideas will be welcomed as well as pointing me to a previous discussion of on a similar tread (which I was not able to find).
Thanks,
George
I am working on a new gadget that is supposed to perform seismic data logging and the design is going to be based around Teensy 3.2 (I wish Teensy 3.6 with much bigger memory was out and well supported as Teensy 3.2 at this point). The board needs to be able to record snapshots of data collected for duration of 5 seconds from 6 ADC channels sampled at 4KHz. The memory requirement is about 240 KB (5sec X 6 ADC channels X 4KHz X 2 bytes per sample = 240 KBytes) of memory with fast access.
The basic program logic is once the trigger is set is to use 25us (4KHz) timer interrupt to collect data for 5 seconds and load into an array. Once 5 seconds is up transfer collected data from the array and write it on an SD card and wait for next trigger which is expected to occur once per minute so there is plenty of time to transfer data to an SD card. The problem is that Teensy 3.2 doesn’t have enough memory to hold that much data and I need some intermediate memory buffer. I am pretty sure I cannot write data to an SD card every 25us since the access times are in the millisecond range. I am thinking of using Microchip 23LC1024 SPI interface chip but that has only 1Mbit (128Kbytes of memory). I guess I might use two of them sequentially to store data.
Another option might be to use some fancy multiple interrupt routines to write to the SD card in bigger memory chunks while the 25us timer interrupt collects ADC data but I don’t have a good idea for how to do this.
Please let me know if you have any suggestions or ideas for how to best tackle this type of a problem. Both software and hardware ideas will be welcomed as well as pointing me to a previous discussion of on a similar tread (which I was not able to find).
Thanks,
George