Double-buffered memory module? - Page 1
Forum section: electronics / projects

author: Spike101
author_rank: Contributor
timestamp: April 17, 2015, 07:06:09 am
content: Hi,I'm looking for a special kind of memory module, but i don't know how it's called and how i can best search for it. Maybe someone here can help me out.I need a (SPI or something) memory module, a few kB in size, which has actually two memory regions - one for reading and one for writing to it. If you write to the writing region, the reading region is not affected directly. Only if a clock signal is generated, everything from the write region is copied into the read region in one atomic operation.The reason is, I'd like to implement a led matrix display which should play some animations, and this kind of frame-buffer would make synchronization very easy..How is something like this called?thanks for your help,Sebastian

author: Marco
author_rank: Super Contributor
timestamp: April 17, 2015, 07:13:41 am
content: Just use an extra dataline (call it BufferSelect) which tells each module which buffer to use, when you're ready updating all the modules change the signal on the line.PS. don't use flash, use SRAM.

author: Ian.M
author_rank: Super Contributor
timestamp: April 17, 2015, 07:16:00 am
content: That's too specialised and alternative techniques exist, (e.g. double buffering) so I doubt its ever been commercially available as a single chip or even as a chipset.With parallel data and address buses it could be implemented in hardware, but the moment you serialise its interface, you need a smart controller to track the current address in each region and can no longer simply toggle an address line to swap regions.

author: cyr
author_rank: Frequent Contributor
timestamp: April 17, 2015, 07:17:49 am
content: You could probably implement that in software by simply having a 2x larger memory and just switching between reading/writing the upper and lower half. The atomic update operation would be updating the read address offset. That's how this kind of double-buffering is typically done.Of course you need to then copy the data from the read half to the new write half manually unless you create the next frame data from scratch each time.

author: Spike101
author_rank: Contributor
timestamp: April 17, 2015, 08:04:09 am
content: Thanks for your replies.Too bad something like this dosn't seem to exist. I would have thought that's a readily available solution..The other idea was to do it in software and just switch pointers, and that's what I'll probably do now.

author: DanielS
author_rank: Frequent Contributor
timestamp: April 17, 2015, 02:38:25 pm
content: Quote from: Spike101 on April 17, 2015, 08:04:09 amWell, when there is such a simple hardware/software work-around that does almost exactly what you ask using commodity SRAM or just a region of regular RAM, how marketable would such a niche atomic copy-on-write RAM be? It would likely end up far more expensive due to how small the market for it is.While it is neat to have a chip that does exactly what you want, sometimes it just is not economically sensible.

author: SeanB
author_rank: Super Contributor
timestamp: April 17, 2015, 04:58:57 pm
content: Dual port RAM is what you want. It has a single memory with 2 separate address and data busses, so each side can write or read at will, with the only problem being writing to the same address at the same time by both sides, where the last to deassert the bus wins, or writing to the same byte while the other is reading, where you will get either the new or the old data read.