Shop OBEX P1 Docs P2 Docs Learn Events
Getting started with RAM? Details on SRAM, DRAM, Flash and EEPROM? — Parallax Forums

Getting started with RAM? Details on SRAM, DRAM, Flash and EEPROM?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-06-07 22:25 in Propeller 1
Ok so Ive been searching through the forums and alot of information about working with the propeller and RAM is scattered about. I was hoping this could be a more detailed thread on the subject to help newbs like myself. I.E if any of the more advanced guys (jazzed, clusso, phil) want to chime in with something important I havent even asked about thats OK with me ;). Im mostly curious about the pitfalls and optimization techniques used with RAM technology's. Id like to Index some links to helpful prop posts about basic things like this, since nothing eve seems to get stickyed(probably be an obscene amount of sickies lol).

Ok so soon ill be running my main programs off a 32KB(256Kb) EEPROM and have two 64KB(512Kb) EEPROMs wired two the i2c bus for whatever purpose. I will also have SD and a 23k256 32KB SRAM chip on board.

So if I am correct this is the order of these technolgy based on speed

SRAM/DRAM
Flash based memmory chips
SD Card
EEPROM

Is this correct? I guess my general questions here would be is SD faster the EEPROM if i use the EEPROM as a read only device (Im sure i have read that somewhere)? Most EERPOM drivers work at 400khz/1mhz while SD on the SPI bus can operate at 20mhz, so if thats true how is the EEPROM faster? Next thing on my mind are flash chips(not quad SPI) really any faster than SD, SD is just flash memory also and its on the SPI bus. Would using my nice class six 6/10 SD cards benefit the performance at all or is the bottle neck in the communication speed between the prop and the SD Card?

Now time to get to actual RAM.. So it seems to me that DRAM is the answer to large capacity/price at good speeds. The issue is mostly one of pincount and writing a controller to refresh the stuff. Is there a controller chip thats pretty standard and easy to work with? Hoe exactly did Jazzed make the 32MB DRAM board and not use up all the pins, a dram controller, shift registers? Speaking of Jazzeds board why isnt it available anymore?? This board seems like a god send for anyone who wants to do hi resolution VGA. What exactly is it about using pins 0-19 for DRAM that speeds it up?? I cant find that answer anywhere!!

For us meer mortals just starting with ram 23k256 SRAM is pretty friendly especially since theres a 30 page app note on this site about using it :). The one thing Im curious about here is how do you connect more than one chip to your prop? can you wire them parallel on one set of 4 wires? I would think if that was so I wouldnt see products based around using PLCs to access 23k256 chips for arduino. Also is wiring a meg of this stuff up (kind of spendy at right under $35 for the chips) going to be helpfull for graphics? Most gif files are wayy under a meg. But lets say for basic GUI capable of at least 720p would a meg cut it? Also are these chips even fast enough at 20mhz?? The up side is they are very usefull and fast compared to any other technology besides the dram listed for just about everything thats not VGA buffers.

Has anyone seen this board http://wardyprojects.blogspot.com/2012/02/laens-pcb-order-my-boards-arrived.html?? Ive been very intrested in buying one but I cant find the guys email address!! I dont even know who he is on the forum but thanks man your blog is why I bought a propeller! How much a performance hit does using shift registers take? And anyone know what chips hes using so I can just get my own batch printed?

Like I said guys i normally wouldnt ask sooo much like this but Id really like to just have a nice thread with all the details about ram stuff, that way theres a really good source of info for us guys new to micros.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2012-06-05 23:18
    Like most things with computers it's a bit more complicated than that. Memory comes in 2 basic types, serial or parallel. Parallel is generally faster but requires more pins to access it. A 128Kx8 parallel memory would need 17 address pins and 8 data pins plus at least 3 control pins. A serial memory of the same capacity could use as few as 4 pins total. The tradeoff is speed. A serial memory is much slower than a parallel one.

    As for speed static ram is generally the fastest, sdram is a bit slower, and eeprom a bit slower yet. Flash and SD are similar technologies that are slower on reading than eeprom, and even slower for writes.
  • ericballericball Posts: 774
    edited 2012-06-06 05:09
    Video requires a lot of bandwidth and/or CPU power (depending on how compressed the video is). The Propeller isn't particularly capable of handling video due to the 80Mbit/sec HUB transfer rate.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-06-06 06:46
    Tunneled gate charge based devices (SD cards, Flash, EEPROM) also have much much slower write times ... on the order of milliseconds and, in the case of flash memory chips, there's a separate block erase cycle that has to be accommodated (you can only write to an erased area). SD cards have internal controller chips that take care of this for you and provide buffering for writes while the erasing, writing, and other bookkeeping is going on. Faster SD cards have more buffers, but eventually they'll all get filled and writes will slow down.

    Flash devices also "wear out". Each erase cycle leaves a small amount of charge behind in the chip's oxide layer. After a while, these small amounts add up to where the charge sensing circuitry can't distinguish between new injected charge and old residual charge and blocks on the chip will no longer erase. Other technologies, like Ramtron's FRAM, work differently. They are functionally packaged to look like EEPROM or Flash, but read cycles are destructive. The chip has to automatically rewrite data that's read and read cycles count against the "wear out" limits which are much higher than typical Flash devices, but still finite. SRAM and DRAM devices don't "wear out", but require power to maintain the memory contents. DRAM, as you've mentioned, require refresh cycles to maintain the memory contents.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-06-06 15:20
    For us meer mortals just starting with ram 23k256 SRAM is pretty friendly especially since theres a 30 page app note on this site about using it :). The one thing Im curious about here is how do you connect more than one chip to your prop? can you wire them parallel on one set of 4 wires?

    There's a schematic for wiring up eight 23K256 SRAM chips in post #4 this thread.

    There have been several people who have used parallel SRAM on the forum (including me).

    Data pins are often on the lowest pins because it saves a shift instruction in the PASM driver making reads and writes faster. This can be very important to the speed of the driver, if the shift causes you to lose your hub access window (as it did in my first driver).

    My using multiple chip select lines, you could add additional stacks of chips. With 13 Prop I/O pins, it would be possible to interface with 32 23K256 SRAM chips giving one megabyte of memory.
  • jazzedjazzed Posts: 11,803
    edited 2012-06-07 08:59
    The original subject and post seems to be looking for more information on making Propeller bigger and what are various approaches. This is an extensive subject that can take lots of time to write.

    Consider these Propeller facts: 32KB HUB RAM, 32KB ROM, 16KB COG RAM, 32 pins (some not always usable for generic purposes).

    There are many ways to make a single Propeller look bigger than it is. Some swap out entire small programs, others swap out little chunks of big programs. Other approaches need multiple propellers. In the end it's all about trade offs and practicality.

    What goals might be considered?
    • Highest density programs (SPIN)
    • Best performance any tiny COG programs (PASM or COGC)
    • Best performance any small programs (LMM)
    • Best performance any big programs (Cached XMMC)
    • Best performance big and deterministic programs (Uncached XMMC)
    • Any acceptable performance program that uses deterministic methods (any program with COG code)
    • Volatile -vs- non-volatile solution (SRAM -vs- Flash, etc...)
    • Lowest cost, simplest configuration, practicality, impracticality (various)
    What solutions are possible?
    1. One Propeller with no EEPROM
    2. One Propeller with 32KB EEPROM (Minimum Propeller)
    3. One Propeller with 64KB+ EEPROM
    4. Minimum Propeller + SDcard
    5. Minimum Propeller + SPI-FLASH and/or SPI-SRAM
    6. Minimum Propeller + SDcard + SRAM (various)
    7. Minimum Propeller + SDcard + SDRAM
    8. Minimum Propeller + QuadSPI FLASH
    9. Minimum Propeller + QuadSPI FLASH and SPI-SRAM
    10. Two Propellers with various solutions
    11. Multiple Propellers with various solutions
    12. A different MCU with Propeller attached.
    13. Others?
    Maybe someone will help fill out info on the various subjects. I don't have time to do it all and deliver on other commitments.


    To answer some specific questions from the original post:

    SDcard -vs- EEPROM speed: It depends on how they are used. If you are loading many small programs into propeller, SDcard is best. If you are swapping read-only chunks of big programs into propeller in a virtual memory system, EEPROM is faster because the chunks can be smaller - SDcards must be read up to 512 bytes at a time to read the last 64 bytes of a sector.

    GG SDRAM board: I suppose Nick decided there was not enough demand for him to continue producing the board - he never told me that though. Last year he had about 8 left i think. If you really want an SDRAM design I provide one for you. I have some of the original boards and parts here. Of course these days we have a solution that can take advantage of SDRAM or other designs easily.

    Thanks,
    --Steve
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-06-07 22:25
    As jazzed and others have said, adding memory is not an insignificant job. It is certainly not for the beginner without a clear understanding of electronics.
    Not to dampen your enthusiasm, but when it does not work you are likely to become frustrated.
    Perhaps it might be better to tackle simpler circuits first where things such as timing etc are not so invloved.
Sign In or Register to comment.