Big serial SRAM - Page 1
Forum section: electronics / projects

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 10:27:13 am
content: Hi,I'm working on a project where I need 1Mbit+ serial SRAM. The biggest I was able to find is the microchip 1Mbit ones, on SPI. But more memory is needed, and there is n way to put parallel memory on the board, because the microcontroller needs to have parallel memory interface for that, thus I need something bigger than a Cortex M0+. So I wonder is there any way to connect big SRAM to a small micro? The budget is thigh, so FPGA or CPLD is out of the question, also those IDT ASICs.It is obvious that I can put more than 1 SPI SRAM on the board.Did anyone solve this problem in a different, clever way? Is there someone making a parallel SRAM with a "hidden" serial interface? Mind to share?

author: TopLoser
author_rank: Unknown
timestamp: November 10, 2014, 10:43:40 am
content: Micro SD cards are serial interface and only need a couple of control lines. You can get them for less than £1 each for a few GB of storage.

author: nctnico
author_rank: Super Contributor
timestamp: November 10, 2014, 11:25:42 am
content: You can always bit-bang a parallel bus. To safe pins you could use 74xx595 shift registers to make the address lines. On a Cortex Mx you actually need to worry about the access time even when bitbanging a parallel interface.

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 11:31:41 am
content: SD card is out of the question, it is flash, unreliable. Few of them are rated to industrial temperatures, where this thing goes.Quote from: nctnico on November 10, 2014, 11:25:42 amYou are suggesting to make an SPI like interface from 74 series glue logic. Interesting.Speed is less of a concern, the size is a bigger one.

author: Kjelt
author_rank: Super Contributor
timestamp: November 10, 2014, 12:12:55 pm
content: Perhaps you can specify the requirements somewhat more precise.From what you have told thusfar I deduce:- interface: serial SPI- size >1Mbit- speed not an issue- volatile storage allowed, power down data lost- operating temperature 125oCIt misses:- how many write cycles endurance?- how long minimum storage lifetime in years with 125oC- how large exactly >1Mbit how much bigger? 2Mbit, 64 MbitWhat you told us thusfar the requirements are not for a single technology.Normally the difference between choosing SRAM vs FRAM vs EEPROM vs FLASH are something like:Technology: Memsize: avg. write cycle endurance: Relative pricefactor: Byte/Page write timeFRAM upto 256 kbit 1000000000000 60 0SRAM upto 1Mbit 1000000000000 30(have to check) 0EEPROM upto 512 kbit 4000000 13 5 msFLASH upto 512 Mbit 100000 1 0.8 msThere are a lot of SPI Flash chips that endure 125oC, and with some errorcorrection/checksums the biggest problem is the write cycle endurance.You will need a form of wearleveling in your software and even then it might quit on you. On the other hand it is dirt cheap (in comparison) so if you take a 10 times bigger chip then really needed you can afford to loose some pages along the way, just keep track of them in your filesystem.So what do you need exactly is it really for instance 8Mbit SRAM or can it be done with 1Mbit SRAM as buffer and 32Mbit Flash as storage.

author: fcb
author_rank: Super Contributor
timestamp: November 10, 2014, 12:16:47 pm
content: Not entirely what you are after. I did a project awhile back where I needed a heap of FLASH and it had go fast - I used 8 serial devices effectively in parallel (so each part was playing out a single bit, effectively multiplying the byte throughput by eight).

author: hli
author_rank: Frequent Contributor
timestamp: November 10, 2014, 12:40:03 pm
content: Cypress has 2MBit F-RAMs available:http://www.cypress.com/?id=4984.Everspin has 4MBit serial SRAMs:http://www.everspin.com/products.php?hjk=SERIAL&a1f3=0

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 01:35:03 pm
content: Yes, life endurance is a problem. It doesnt need to work at 125C, 85C devices are fine, but SD card is not, and I would not put there flash memory at all. Fram and Mram is out of the budget, it needs to be close to the 4 USD (@1000) price of the two 23LC1024 from microchip to consider. Sram is the correct technology to use, with battery backupPersonally, I would go for the SRAM+Flash combo, but the programmers are not happy with it. They triedSo to answer your question:SPI or maybe I2C2-4-8 mbitSome 100Kbit/sec speed85 degreesbattery backup (which is fine) or non volatile (which is either flash or not cheap)endurance is necessary, it needs to be at least as endurable as an EEPROMPrice about 4-6 USD in 1000 quantity

author: David Hess
author_rank: Super Contributor
timestamp: November 10, 2014, 02:25:51 pm
content: Assuming that you can get the required speed from a single serial SRAM, then I think your best option is to use multiple serial SRAMs. If I wanted more speed, I would use 4 or 8 in parallel and implement a parallel SPI or I2C interface but interfacing with the microcontroller could be a problem and it would take more I/O pins.An external 3-to-8 decoder could be used to minimize the number of pins required for SPI chip select or chip select could be generated by an I/O expander. I2C would have an advantage here as far as the number of pins required.If I wanted a lot more capacity, then I would implement a full parallel interface on an I/O expander and use a parallel SRAM.

author: ovnr
author_rank: Frequent Contributor
timestamp: November 10, 2014, 02:35:53 pm
content: Just buy several chips? 1Mbit SPI chips arearound $2/pop (1k).Just parallel up the MISO/MOSI/CLK pins, and run separate CS lines. If you absolutely must have a continuous memory space, emulate dual/quad SPI by running data lines separately too, but you'd need to emulate it in software.Or you could always stick on a CPLD + some parallel SRAM. 8 Mbit of parallel SRAM can be yours for $3.70 (1k) + $1-2 for a CPLD with glue logic.

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 03:36:13 pm
content: Quote from: David Hess on November 10, 2014, 02:25:51 pmThat is clearly possible, that is the original solution I mentioned in the first post. I was wondering if there is a parallel memory with serial interface, because I remember I saw it somewhere. And indeed, I found it, it is the Micron PCM memory."A serial peripheral interface has been added as a secondary interface on P8P parallelPCM to enable low cost, low pin count on-board programming. This interface givesaccess to the P8P parallel PCM memory by using only seven signals, instead of a conventionalparallel interface that may take 45 signals or more."Now, PCM is unfortunately dead, and it doesnt look like others used this interface.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 03:45:40 pm
content: Cheapest for production volumes would be a parallel SRAM as big as you need plus a small CPLD to handle SPI interfacing.Though you may find that multiple SPI RAMs could be a simpler solution.

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 04:11:38 pm
content: Quote from: mikeselectricstuff on November 10, 2014, 03:45:40 pm4 megabit parallel sram is about 2,5 USD, and a 128 macrocell CPLD is about the same. So I guess this might be indeed viable.

author: David Hess
author_rank: Super Contributor
timestamp: November 10, 2014, 04:46:29 pm
content: Quote from: NANDBlog on November 10, 2014, 03:36:13 pmI never considered this a feasible solution because a specialized memory would be more expensive than something available from multiple sources.There is a parallel version of SPI which I discounted for the same reason.All of the other options I found were more expensive than using multiple 1 Mb serial access SRAMs.

author: Scrts
author_rank: Frequent Contributor
timestamp: November 10, 2014, 04:56:29 pm
content: Your only option is to use several of SPI SRAMs.If you would consider parallel SRAM plus CPLD, include all the decoupling needed for the CPLD, plus programming header, some pullups/pulldowns, PCB area, effort to do the CPLD design, better power supply, that would provide enough current... Probably it's not the end of the list. I imagine you will need better than commercial grade CPLD, so check the price of the industrial one.I didn't quite get the point. You have a microcontroller, that has the parallel memory interface, but this is already used for another purpose? Usually, those interfaces can be shared between multiple devices.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 05:13:29 pm
content: Quote from: NANDBlog on November 10, 2014, 04:11:38 pmyou wouldn't need anything like 128 macrocells. should be doable easily in 64, which is a lot cheaper.. All you need is a shift register for address and another for dataif you don't want to get into CPLDs then you could also easily it with an MCU, but CPLD will probably be cheaper due to the number of pins. Another, possibly cheaper option if speed isn't an issue is a bunch of HC595s, a parallel in register (don't recall HC number offhand) and and a couple of extra control lines. This would also be very low power, close to zero when idle.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 05:20:56 pm
content: Quote from: Scrts on November 10, 2014, 04:56:29 pmNegligibleQuotePCB pads, or could be programmed by the MCUQuoteWhat for?QuoteApplicable to any solution. If you know HDL then the CPLD design would be simple - a dozen lines maybe.QuoteUnlikely to need much - maybe 10-20mA active.

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 06:27:08 pm
content: Quote from: Scrts on November 10, 2014, 04:56:29 pmNo, I have a microcontroller (in my proposal) without external memory interface. It is a small 48 pin, M0+. Then they asked for (a lot) more memory. The usual air balloon of the requirements. So we just snapped two SPI SRAM's price to the budget, because we did not had the time to investigate all the options. Now I have the time.Quote from: mikeselectricstuff on November 10, 2014, 05:13:29 pmAnd the OE or the WE signal timing is bit banged? I'm kinda tempted to use a CPLD, I havent had the chance to try them in the past.But in fact, I came to a conclusion. It is worth to upgrade your microcontroller to a higher pin count one, if you need to have this much external memory. An 1 Mbit SPI RAM costs almost the same as a 2 Mbit parallel SRAM, and it just becomes worse than this above 2 Mbit. Switching from the M0+ to an M3 with 100 pins and memory interface is almost the same cost as one chip of the SRAM! I can design the board with peace in my mind, that more memory will fit in the same footprint. Not to mention the additional benefits of the bigger MCU. This was a bit counter-intuitive.If your memory costs more than the microcontroller, you are obviously doing something wrong, right? Thanks everyone for the help!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 06:33:16 pm
content: Quote from: NANDBlog on November 10, 2014, 06:27:08 pmOr you could use HC595 pins for CS,WE etc.

author: nctnico
author_rank: Super Contributor
timestamp: November 10, 2014, 08:43:01 pm
content: How about looking for a controller with enough internal SRAM?

author: Scrts
author_rank: Frequent Contributor
timestamp: November 10, 2014, 08:52:34 pm
content: Quote from: mikeselectricstuff on November 10, 2014, 05:20:56 pmRegarding pullups/downs -> You probably still need some configurations pins to be set up.PCB pads for programming means no firmware upgradability for user.Regarding the HDL coding: if you want something, then yes, it's probably a dozen lines. If you want something really reliable, then it's not so easy.

author: David Hess
author_rank: Super Contributor
timestamp: November 10, 2014, 08:53:58 pm
content: Quote from: NANDBlog on November 10, 2014, 06:27:08 pmThis also allows fast direct access although in some applications that is not an advantage.Quote from: nctnico on November 10, 2014, 08:43:01 pmI hunt for these regularly and always come away disappointed. Internal program memory sizes increase but they never have enough internal SRAM. The holy grail for me is a microcontroller in a small but easy to use package with lots and lots of SRAM and enough program memory.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 09:02:28 pm
content: Quote from: nctnico on November 10, 2014, 08:43:01 pmBecause there aren't any.You just don't get huge RAM on micros. The biggest I know of offhand is 512K on a PIC32MZ

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 09:04:55 pm
content: Quote from: Scrts on November 10, 2014, 08:52:34 pmIt's unlikely you'd need to update something this simpleQuoteYes it is - it's just a bunch of shift registers, and clock rates will be way below device capabilities so no need to worry about timings

author: nctnico
author_rank: Super Contributor
timestamp: November 10, 2014, 10:00:37 pm
content: Quote from: mikeselectricstuff on November 10, 2014, 09:02:28 pm1Mbit=128KByte so there is enough choice. If a lot of memory is required some of the higher end parts have the ability to use an SDRAM. The multiplexed address bus reduces the number of pins.

author: Kjelt
author_rank: Super Contributor
timestamp: November 10, 2014, 10:01:14 pm
content: Quote from: mikeselectricstuff on November 10, 2014, 09:02:28 pmYes there are! You make the mistake mixing Mbit with Mbyte. TS needs 2Mbit which is 256kB RAM.Some Arm32 M4's have it and the new M7 from ST even has 320kB = 2,5Mbit

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 10:05:01 pm
content: Quote from: Kjelt on November 10, 2014, 10:01:14 pmThe problem is that the few chips that have a lot of RAM come with a buttload of other stuff you don't need if all you want is RAM. The pin-count for all this other stuff often puts it into BGA-land, and pushes up the price.

author: Kjelt
author_rank: Super Contributor
timestamp: November 10, 2014, 10:16:04 pm
content: The STM32F-427/429/437/439 are all available with 256kB RAM in lqfp100 and144 packages and depending where and how many you buy probably can be had for around €5 maybe even lower which is not bad if the TS was already willing to spent $4 for that amount of SRAM alone.Then you get a lot of DMIPS for free and indeed a ton of other goodies.

author: tszaboo
author_rank: Super Contributor
timestamp: November 10, 2014, 10:52:23 pm
content: Quote from: mikeselectricstuff on November 10, 2014, 09:02:28 pmThere is no way I'm going to touch the MZ for another 3 silicon revisions.Quote from: Kjelt on November 10, 2014, 10:16:04 pmIt seems more like 10 dollars for a tray. I was calculating everything above in dollars, digikey prices. The other problem I see with 256KB memory is that our programmer's stated 256KB, or 2 mbit for the data alone, not including stacks and stuff. Maybe I can bargain a bit with them, but if in the end they need more than that, there is just no backup solution. Unless I design it with a big memory MCU+not populated SRAM.Quote from: David Hess on November 10, 2014, 08:53:58 pmSaves a bit of code and dev time.I know that the best would be a Cortex M7 with megabytes of MRAM in packages ranging from 8 pin to 512, but we are still not there yet.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 10, 2014, 11:32:55 pm
content: Quote from: NANDBlog on November 10, 2014, 10:52:23 pmI've never understood why they don't fix all the issues in one rev.

author: Jeroen3
author_rank: Super Contributor
timestamp: November 11, 2014, 07:40:23 am
content: Quote from: Kjelt on November 10, 2014, 10:01:14 pmBut they don't have it in a single continuous block, do they?ST's and NXP's flashless LPC43 have a lot of ram, but spread over different banks, where only some area's can be used by the dma.

author: Kjelt
author_rank: Super Contributor
timestamp: November 11, 2014, 07:56:31 am
content: Quote from: NANDBlog on November 10, 2014, 10:52:23 pmFrom your previous statement:Quote from: NANDBlog on November 10, 2014, 01:35:03 pmI thought you were needing a 1000 pieces. Even if the first series is tens of boards and the future potential is 1000('s) it is time to contact ST directly and forget about Farnell/Digikey and sorts. It will take some time to do the negotiations/meetings but at least you have a contact for future projects. But if you indeed only need a few than you can stick to the Farnell prices.

author: Kjelt
author_rank: Super Contributor
timestamp: November 11, 2014, 07:59:14 am
content: Quote from: Jeroen3 on November 11, 2014, 07:40:23 amIt didn't say in the requirements that it had to be in one continuous block.It did say that speed was not a big issue, so DMA is not necessary and since internal addressing is tens times faster than SPI addressing, a few extra loc's to switch to the correct RAM bank won't be an issue. But still a good point to think about.

author: tszaboo
author_rank: Super Contributor
timestamp: November 11, 2014, 09:22:19 am
content: Quote from: Kjelt on November 11, 2014, 07:56:31 amIT was a 520 tray. There are company policies, like we buy from distributor all the times, or we subcontract the purchasing to the assembly company. I know, that the price will be lower than the digikey price, but the decision has to be based on something which is comparable. And that is pricing from a single vendor, or once I have the components and the quantities in mind, a quotation from a vendor. With lead times and better payment terms, which can be more important than just the price alone.I mean I can contact microchip and get a better price, or contact Sunny Happy RAM manufacturer to get a better price for the SRAM.

author: nctnico
author_rank: Super Contributor
timestamp: November 11, 2014, 10:00:37 am
content: Quote from: Jeroen3 on November 11, 2014, 07:40:23 amIIRC those banks are usually mostly in a contiguous memory space in the NXP parts. Many years ago I wrote a memory management library supporting malloc, free and realloc which could deal with several memory areas.