Yet another SPI Flash question

Status
Not open for further replies.

hoho

Well-known member
Hi,

There is a number of threads on SPI Flash, the data is rather scattered and incomplete though. I would really appreciate some clarification.

I need to record fragments of audio (from the ADC board), store those fragments and continuously play them back (variously mixing and applying some effects/calculations). Each recorded fragment length is about 2 minutes. Theoretically there might be infinite number of fragments, but practically up to 10 recorded ones at a time (and I need to play them all back mixing them simultaneously).

SD card doesn't seem to be an option, so, I'm looking at SPI Flash.

What is the easiest way to get SPI Flash to my project without AudioBoard? In the various topics I read about various chips, some of them are 8 pins, but some are 16. People solder 8 pins chips to the AudioBoard, but what about 16 pins?

As far as I understand, 128MB is the maximum I can get with 8 pins. Which is not a lot, but should narrowly fit my requirements. I've found SPI Flash Breakout Board on eBay (https://www.ebay.com/itm/SPI-Micro-Board-for-Arduino-Flash-Storage-Module-Board/163474532295), they use W25QXX, but only up to 16MB only. But I can also find W25Q128FVSG chip there which is 128MB (https://www.ebay.com/itm/5pcs-WINBO...SIG-W25Q128FVSIG-25Q128FVSG-SOP8/261519959238). Should it work if I solder that chip on that board and will try to connect the thing to Teensy 3.6?

Are there other/better options? Not just the memory chips, but the complete solutions with the boards (ideally I'd like to have 256 or 512MB of space available)?

Thanks.
 
And I actually even doubt that flash memory is what I need. It seems I can't overwrite the data without erasing it first and the time to erase seems to be insane on a flash chip (tens of seconds to minutes)...
 
And I'm even more confused because in some specs W25Q128FVSG is 128MB in some others it's 128M-bit...

The convention virtually semiconductor vendors use it Mbit. You can be pretty sure any serial flash chip with "128" in the part number for capacity is in fact 16 Mbytes of storage.
 
Some notes for SPI flash based on my experience:
Maximum size I have seen is 128Mbit. This is 16Mbytes, max.
The most common form factor is 8-pad DFN/QFN. They can be hard to solder but not impossible with hand tools.
100MHz allows for some fast speeds, especially if you can use QSPI mode (x4 the data rate).

Bigger flash IC, the kind found in USB drives, typically use eMMC protocol which is a bit more complicated and usually only come in BGA formats.

From your requirements is there any reason you cant use a microSD card? Have you tried the Teensy 3.5 with onboard SD. With some SRAM buffering microSD should be plenty fast enough for your application. Its good enough to stream 4k60 video!
 
Thanks for the response! I will really try SD card. As you say, there is a chance that it will do the thing. It's just I've been looking at the similar reasoning (with some bandwidth calculations) in some other thread. Having the bits of information scattered across the internet makes it harder to be the new kid on the block :). If not for the misleading specs (measuring everything in Mbits when you've used to Mbytes) and with the initial knowledge about the extremely slow erase, I think I wouldn't be considering SPI Flash at all.

Anyway, even if not the SD card, I have a couples of other ideas and the memory problem is definitely solvable. So far the not working simultaneous I2S quad channel input/output is a general blocker for my project :(. Hopefully it could be resolved.
 
So far the not working simultaneous I2S quad channel input/output is a general blocker for my project :(. Hopefully it could be resolved.

It can easily be solved when you use a 4 (or more) channel codec like the CS42448 in TDM mode.
 
It can easily be solved when you use a 4 (or more) channel codec like the CS42448 in TDM mode.

I try to realistically estimate my capabilities and that CS42448 is over my head for now.

I am a software engineer with a little Arduino experience. I can solder the pins to the board, I can solder a resistor if I know exactly which one and the description says «put the yellow wire into the purple socket number seven». I still fear the capacitors.

If I could solder non-trivial things myself I would likely not be buying Teensy. I might grow the required skills over an uncertain amount of time, but with the solutions available (like Teensy, presoldered tiny boards for ADCs, DACs, op-amps) the ideas seem to be implementable already even with my current experience. And the ironical part is that it really seems to be so and with just a little bit of firmware adjustment... It's unfortunate that those adjustments are currently out of my expertise too. It’s either a miscofigured chip, or a misconfigured DMA (or both). I have started an uneasy reading about the Kinetis DMA, which so far has given me a lot of moments feeling stupid. That is why I am crying out for help from the people who have eaten a dog on it. Actually, the glimpse of Teensy’s Audio library and the assumption that the structures in it work together were the only buying factor to me.

Sorry, that was a huge offtopic sponsored by «WTF is that thing» driven development period.
 
So far the not working simultaneous I2S quad channel input/output is a general blocker for my project :(. Hopefully it could be resolved.

Has this problem been properly reported yet? It's not on my list of issues to investigate. Maybe I just missed the thread or message?

When I say "properly reported", I mean a detailed message with complete code that can be copied into Arduino and uploaded to a specific Teensy connected to 2 audio shields. If not clear from the code, a proper report also needs to make clear what the code is supposed to do, what types of signals should be put into the 4 inputs and what should be observed at the 4 outputs, and any other info needed for anyone to reproduce the problem.

If a proper report already exists, please point me to the message so I can put in on my list of issues to investigate.

If there isn't yet a proper report, I hope you will consider creating one. You don't need to be an expert to simply post the code you tried and take the time to write instructions for anyone else to run it the same way, so they too can see the same problem you experienced.

I can tell you with certainty, in the absence of a message with reproducible steps, this problem will probably never be investigated, much less fixed. A clear message with complete code and reproducible steps is an absolute requirement. I definitely will not try to create a program from scratch to recreate a vaguely described problem such as this.
 
However, I can give you one small tip. The most common problem we've seen when people try to process more channels is not enough audio buffer memory allocated. If you have something like AudioMemory(10) in your code, increase it to 50 or 100 buffers. When you only process mono or stereo and you do something pretty simple where each effect just modifies the data and passes it along to the next effect, you can get by with relatively little memory. Expanding to more channels or doing more complex processing can require more buffers. Many times we've seen CS42448 input reported as not working and the problem turned out to be not enough buffers, sometimes not even 16 buffers! Hopefully it's obvious that an input that's giving you 16 simultaneous steams would need at least 16 buffers on every update...
 
Status
Not open for further replies.
Back
Top