9 years, 7 months ago.

Do I need RAM?

I am having a problem with the speed of data I can transfer from my MCU.

My project involves using an MCU as a position controller for a microscope. While the microscope is operational (which is only for a few seconds at a time) there is a constant stream of data being transferred to a PC for analysis. The data includes 3 dimensional positions and error checking.

The rate I want to produce data is 26 MBytes/Sec, but the comms controller on my board has a maximum USB speed of 1.5 Mbytes/sec.

So I see my options as: 1. Produce less data: I do not want to do this. 2. Use a faster board: Would also prefer not to do this 3. Use on board storage. ie SD: I am not sure if I could obtain the required speed doing this 4. Use external ram as a buffer: I am not sure how to utilise external ram

I'm not sure how to continue from here, any help would be greatly appreciated. By the way I am using an STM32 on a Nucleo F401RE board.

1 Answer

9 years, 7 months ago.

Just double checking, that is 26 MBytes not 26 MBits right?

That means you need something that can sustain a data rate of over 200MBits / sec consistently. Yes only for a few seconds but a few seconds at that sort of rate is a lot longer than people mean when they talk about peak data rates for short periods of time.

RAM is the only thing that has any hope of keeping up, SD or flash will be too slow. A HDD connected via SATA would be able to keep up but that's not an option on your hardware. And even after adding the required 64MB of RAM you're pushing it, assuming your data in and out are both 32 bits wide you have about 16 CPU clock cycles to read the data, store it, increase your counters, check if you are finished etc... Realistically you may still need to look at a faster board or trimming some of the data even with external RAM.

To be honest if I was set to do a task like this I'd take the processor out of the data collection loop completely and use an FPGA to buffer the data into a RAM chip (or a bank of RAM chips given the size needed) and then use either a small MCU or the FPGA itself to stream the data out at a lower rate. mbed has it's place and shifting sustained data rates of several hundred Mbits/s is not it.

Accepted Answer