cancel
Showing results for 
Search instead for 
Did you mean: 

SPI external memory: Multiple SRAM 4Mbit IC, or a single NAND/NOR 16MByte IC, which is less trouble?

manurp
Associate II

Hi, first of, I am not sure if this is the right forum to ask this type of question. Feel free to redirect me if needed.

So I am using STM32F446RE development board for an electric guitar looping pedal project. For my application, I require some amount of external memory to be added to save a couple seconds of guitar signal, to then be able to play it back in a loop. This raises the question: What would be the best type of memory to use for this application?

I am sampling at 48Khz/12bit and ideally would like to save at least 20 secs of music, which would require at least 1.5 to 2Mbyte of external memory.

Note that altough I understand the principles of SPI communication, I have never used it in a project, which is why I ask for your help on this one.

So I started looking for SPI/QSPI, DIP8 or SIOC8 memory IC on Digikey, and it seems my best two options are the following:

  • Interfacing with a single slave NAND/NOR Flash IC, which can hold many more Mbytes that needed (8MB, 16MB, and even more).

What would be the most efficient for my application? I would ideally like to be able to overwrite data written in memory (to, for example, add two signals together), so using Flash memory might cause some headaches when dealing with erasing and rewriting data (might also be too time demanding, depending on the chip).

On the other hand, since the SRAM module do not feature enough memory in a single IC, I would need to interface with multiple, I estimate at least 4 slaves, which I think shouldn't be too complicated with a correct managing of ChipSelects. How hard is that to manage? Do you have any example code to guide me through this?

I would really appreciate your insight on my issue,

Thank you very much

14 REPLIES 14
berendi
Principal

Does it have to be that STM32F446 board?

If the main plot is the analog/audio processing part, I would just save myself the trouble of hooking up the external memory.

Get a STM32F429 board with some onboard RAM, e.g. the Waveshare Core4X9I, or STM32F429I-Discovery, both have 8 MByte SDRAM.

manurp
Associate II

Thanks for your answer berendi, and sorry for taking so long.

I do not necessarily have to use this board, it is just one that I already so that was why I chose it to begin with.

I had actually not thought of using another devboard, though it seems like a great option. I would still however prefer staying in the STM32 family, as I use STM32CubeMX to generate my projects.

Tell me, why specifically did you recommend the STM32F429 board over the couple other options which feature onboard RAM? I see that the STM32F429I-Discovery features, among other things, an LCD screen, which I do not technically require for my application. I will look more into what other options are available.

Thank you!

QSPI NOR in a SOP16 300mil package opens the most doors. The 8-pin chips just have a lot of unhelpful/incompatible land patterns.

Would avoid NAND, can't read/execute-in-place. For storage an eMMC is probably a cleaner route, basically a soldered down SD/MMC card

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you for your answer clive1, I appreciate your feedback

I have looked into it, it does seem promising. However, I will proceed with a STM32 Discovery card that features the amount of memory I require, as I really would rather not have to get into PCB design. Perhaps some SOP16 to DIP16 adapter would be appropriate, but then again I'd prefer to focus the time I have left on pushing out more features.

I just picked the cheapest among ST products which has some onboard RAM. But ST puts SDRAM on its boards only when it's needed as LCD framebuffer.

Waveshare Core4X9I has the same STM32F429 MCU (maybe with more pins) and SDRAM only.

If you have already started coding for the STM32F446, it would probably work on the STM32F429 too, with no or very minimal changes.

correct me, if i´m wrong... But what about lifecycle of the internal memory cells? Flash memories tend to wear down after heavy use... As long, as it´s not necessary to store these guitar samples after "power off", i always would prefer SDRAM 🙂

/Charly

Yes, I already have some code working on the Nucleo STM32F446RE board. So far, I have the ADC and DAC set in 12 bit with a 48kHz internal clock and DMA to internal memory.

If that doesn't bother you, I have some other questions regarding the STM32F429:

1) Can I use the whole 8MByte of SDRAM available, knowing that I would not be using the LCD screen at all? Would I need to deactivate the LCD screen? I actually might only need 2-4MB for my app.

2) When I go to create a project on STM32CubeMX, I see that not many pins are left unused, probably due to both the external memory and the LCD. I also notice that this board is not advertised for audio/ADC/DAC anywhere, but the STM32F429 MCU itself does feature ADC and DAC, and verifying on CubeMX, it looks like 2 pins are usable as ADC (I will use 1 for audio sampling, the other one for a potentiometer as some sort of volume control) and 1 as DAC (that I would use as audio output). I also still have room for a couple of GPIOs that I could set as External interrupts to trigger when I start recording and when the recording stops. In conclusion, it seems that I have access all the functionnalities that are required for my project.

Knowing all that, am I all set? Or should I look into the other Discovery boards with over 8MB RAM, which seem offer audio features such as audio codecs, line in/out, audio DACs, etc? What more does this allow, compared to using the 12bit ADC/DAC embeded inside the STM32F429, for example?

Once again, thank you for your time, I really appreciate it.

That is correct.

I would definitely prefer SDRAM over Flash memories, as I do not need to store the guitar signal after poweroff, SDRAM has unlimited uses, no need to erase whole pages to modify data (which could be an issue for real-time audio apps, depending on how much time the erasing process demands).

My issue was finding SDRAM that was hand solderable (i.e. SOIC/DIP) with enough capacity: On Digikey, I was only able to find about 4Mbit per chip, while i would need 2MByte minimum in total..

Thinking about it, you'd better off with a board that has some form of audio support already present. The STM32F429 board has only minimal separation of analog and digital supply lines, so the audio quality might not that great, but I'm not into audio processing to judge that.

The STM32F746G Discovery board with the onboard Cirrus/Wolfson codec might offer better quality audio.

The onboard SDRAM can be used for any purpose, it is not tied to the LCD display. The display is not active unless your software configures it. Even if you change your mind later, and use the display e.g. for touch controls, a framebuffer for a 480x272 display takes 128 to 512 kilobytes of memory depending on the colour mode.