Shop OBEX P1 Docs P2 Docs Learn Events
whats the best way to add external ram? — Parallax Forums

whats the best way to add external ram?

vampyrevampyre Posts: 146
edited 2008-04-24 00:49 in Propeller 1
I've always wanted to build my own computer. I've now got some free time
ahead of me, so i'm looking at options. The prop seems to be the logical choice
since it has video support built in. Then i stumbled on PropDos. too cool, thats
just what i wanted to do. My real desire is to write my own OS. Sadly, I'm a
bit of a noob when it comes to logic electronics.

I have used basic stamps for a while, and even programmed a PIC or two in my
time, but this project is all together more complex.

My basic design idea is to use the propeller, the datalogger for long term file
storage, and some SRAM for temp data storage.

I hope someone can help point me in the right direction before i invest money
in the wrong stuff.. here are my questions

1. is SRAM the best way to go? I want something that can handle lots of write
cycles, and SRAM seems simpler to use than DRAM, and certainly better than
flash for repeated writes. Am i right in my assumptions ?

2. I have found this chip on jamecos site that looks really nifty.
www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=157358

-would it be a really hard task to use this chip with the propeller?
-Am I right in thinking that I could dedicate one of the propellers cogs to reading and writing to this chip?
-would it eat up all my program space on the propeller trying to implement this?

nebulous question: Does anyone know where I can go to learn 'how' to hook this or
any other external ram to a micro controller? Maybe a link to a project that does this
so i can see how its done in code and hardware? That'd be just nifty.

thanks in advance for any help, pointers or responses
«1

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-19 11:15
    Welcome to the forums vampyre,

    For mass storage you can use an SD card. This is easy to hook up to the prop using just a few resistors.

    1. If you need more memory space for variables then SRAM or a different micro is the way to go.
    2. That chip will be a bit hard to use with the propeller because it requires the use of 30 pins.

    If you want to play around with some SRAM you could get a this card www.parallax.com/Store/Microcontrollers/PropellerTools/tabid/143/CategoryID/20/List/0/SortField/0/Level/a/ProductID/444/Default.aspx. Its more expensive but should be a lot easier to use and other people on the forum have it and could be able to help you.

    The Hydra has a slot that you can use it with, however, you won't be able to use it with an SD card. So you could get a Hybrid which you can use the SD card and SRAM card with.

    The propeller wiki propeller.wikispaces.com/Dev+Board+Differences and ignite automation www.igniteautomation.com/ have some info on both boards.
  • vampyrevampyre Posts: 146
    edited 2008-04-19 12:14
    wow, thanks for the fast reply.

    I had looked at the xtreme 512k but its just not in my budget goals. I'd like for the entire computer to cost $100 or less

    You say that the chip will be hard to use for needing so many pins.
    What about using a second MCU as a dedicated controller for the SRAM?

    I had also considered SD for data storage due to its lower cost. I still havn't decided for sure, but if i'm not mistaken,
    currently the only object available to use SD cards supports only the root directory.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-19 13:05
    You could do that but that ram chip requires 30 pins to interface with it. If you wanted to use a propeller it would be a little difficult because 4 of the pins are used during boot up. If you used 2 of these pins you could do it but than you would only have 2 pins to communicate with the other prop.

    The solution on the xTreme 512K card takes is to use a CPLD (complex programmable logic device) to act as the interface between the prop and the sram chip so that only 10 pins are needed on the prop.

    I guess the real question is do you really need the extra space? Some of the games that have been developed are quite impressive. If there isn't enough space could you store some things on the SD card? Another option would be to just get another prop to do the things that eat a lot of memory like video.

    If you want less than $100 I would probably get a proto board with the addon pack for VGA, kb and mouse. Its pretty easy to add sound, SD and tv to the proto board as well.

    The current SD card drivers only do the root directory. However, Mike Green is working on a new version that will be able to access directories but he's having problems with it corrupting files and things at the moment. Again, if you want to use the datalogger its going to be hard to keep the price below $100.
  • hippyhippy Posts: 1,981
    edited 2008-04-19 13:47
    It depends on how much RAM you want and access speed. I did some work
    on an I2C Slave RAM using just a Propeller which will give 32Kx8 RAM ( plus
    ~24Kx8 Eeprom ).

    There are also FRAM devices which are I2C Eeprom but AIUI don't have the
    same limited number of write/erase cycles.
  • jazzedjazzed Posts: 11,803
    edited 2008-04-19 18:22
    Some ideas beyond those described are presented below .... CHOP CHOP CHOP. On further review of the Propeller Protoboard with VGA, the ideas previously presented·by me in this post·regarding serial upper address and direct SRAM connections are mostly unfeasible. The VGA takes up 8 pins on Propeller ....· Yuck.· Considering other solutions now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley

    Traffic is slow at times, but Parallax orders·always get here fast 8)

    Post Edited (jazzed) : 4/20/2008 2:49:32 AM GMT
  • AleAle Posts: 2,363
    edited 2008-04-19 21:54
    To connect a SRAM you need quite a bit of pins, as you know. One possibility is to use a transparent latch to hold the addresses, the high weight ones. 1 Latch spares 7 pins, you need 1 for ALE. so 2 latches can spare 14 pins and for a 128 K SRAM that requires 17 Addresses you can have the LSB without latch that will give you: 8 Data + 1 OE + 1 CS + 1 WR + 2 ALE + A0 = 13 Pins instead of 17 + 8 + 3 = 28 Pins.

    That is real and works for me (but just with one latch).

    Another possibility, similar in "spareness" is to use a DRAM., well a 256kx8 found in old SIMMs (72 pin or 30) spares also loads of pins because addresses are already multiplexed, and you sure spare 2 latches, but it is DRAM, it needs refresh, these DRAMs are simple to refresh, just get a 44C256 datasheet. The timings can be achieved, just do not expect to access them at 70 ns.

    Other serial possibilities exists as was mentioned before, but they are dog slow compared to any of these two. Anyways some sort of memory management will have to be implemented, and the refresh can be implemented there.
  • jazzedjazzed Posts: 11,803
    edited 2008-04-19 23:37
    Oh yea! [noparse]:)[/noparse] That's the ticket.
    I forgot about the old 8088 "ALE" Address Latch Enable method. I have some 74LS374 chips. Double access time for address setup and latch for all accesses relative to one-to-one address/data connections, but simpler from a code perspective and faster accross boundaries (with no attention required for where the data is) than solutions I described before. Twice as much soldering but that's ok. .... Think I'll build a prototype [noparse]:)[/noparse]

    DRAM is a more complicated and requires a COG or a piece of one for refresh but is of course doable. It will take longer to get right and won't save as many pins as the address latch method, but is less power hungry. Any older hobbyist will certainly have lots of DRAM somewhere [noparse]:)[/noparse] Not sure if older DRAM type DIMMs are widely available in production now like DDR & SDRAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley

    Traffic is slow at times, but Parallax orders·always get here fast 8)
  • hinvhinv Posts: 1,253
    edited 2008-04-20 00:55
    I think you should go for a 2 prop approach with a 10 line bus between them. There are already at least 10 single prop boards out there. Yeah, 2 props aren't as easy to program as one, but you can have 44 I/O's to allocate between them instead of 32, and the propeller makes a good, cheap, programmable I/O adapter. DRAM might be a good way to go on these as the parts can be almost free, but how much throughput do you think you can get out of them? 70ns is around 14MB/Sec, not that fast a ram goes.
  • vampyrevampyre Posts: 146
    edited 2008-04-20 01:02
    You guys rock, I'm happily suprised with the varied ideas and responses. Thanks so much for all the feed back and ideas.
    Its definately gonna give me plenty to play with for a while. I like the latch idea, i think im gonna explore that. Thanks again for all the help
  • jazzedjazzed Posts: 11,803
    edited 2008-04-20 01:42
    I found 6 old-style 1Mx9 DRAM SIMMs in my garage. The smaller form-factor, relative ease of assembly, and immediate availability are attractive. Since I only have 64K of SRAM on hand in 8 chips no less, I think I'll follow the DRAM path.
    The DIMM fits neatly on the protoboard but don't have room for the socket ... fingers crossed [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley

    Traffic is slow at times, but Parallax orders·always get here fast 8)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-04-20 01:55
    Grab a copy of the original Propeller Cookbook and the updates
    from propeller.warrantyvoid.us

    You should be able to build a working setup for well under $100.

    Also, you might take a look at what Brian has at www.ucontroller.com

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • vampyrevampyre Posts: 146
    edited 2008-04-20 04:06
    Jazzed said...
    I found 6 old-style 1Mx9 DRAM SIMMs in my garage.
    I wouldn't mind a shopping spree in your garage, I bet its filled with all kinds of neat stuff.

    OBC: got it bookmarked. thanks! I'm sure i'll be drawing lots of inspiration from(blatantly stealing ideas from) your work in the near future.

    hinv: I do want two props I think, if for no other reason than to be able to say I built a 16 processor computer smilewinkgrin.gif
    I am thinking one for video/audio/keyboard/data device, one for processing and ram access

    hippy: i hadn't heard of FRAM till you mentioned it, fascinating stuff. unfortunately i have constant hand tremors that
    make soldering a *real* pain in the neck, and i don't think its available in a DIP package. any thing with smaller pins is out of
    my realm of usability. Thats gonna be a problem in the not-to-far future I'm afraid
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-20 05:09
    Can you solder SMT using solder paste and hot air? The soldering stations to do it are more expensive but its fairly easy to use.
  • vampyrevampyre Posts: 146
    edited 2008-04-20 07:40
    I dont know how that is done. The real problem i have is lining up the small parts, my hands knock them all over the board. with through-hole parts, once you get them in the holes, they stay pretty well. eventually i'll probably be building a custom solder station complete two robotic arms with twitch cancelation in the code that controls them so i can do detail work, but thats a whole different project [noparse]:D[/noparse]
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-20 08:12
    Okay, it will probably be a bit hard to use then. What you want is a pick and place machine but they are a bit expensive smile.gif.

    Can't you get SRAM with an SPI interface? That should be reasonably quick and only use 4 pins (only 1 if you shared some of the pins with the SD card).

    Edit: Here's one but its in a SMT package www.endrich.com/en/site.php/30723

    Edit2: That chip is only 32kBytes and I can't find any others.

    Post Edited (stevenmess2004) : 4/20/2008 8:43:28 AM GMT
  • vampyrevampyre Posts: 146
    edited 2008-04-20 08:55
    yeah i couldn't find any decent sized (256k or bigger) serial sram. would be *great* if someone would make some.
    till then using latches seems to be my best route.

    I looked at a video over on sparkfun about hot-air smt soldering, and yeah there's no way i could manage that. so once i finally decide to get into it , which will probably be the project after this one, i'll start working on my "evil machine building evil machine".
    I want to finish this one first though, because I want to use this project as the brains for the robot arms.
  • Ym2413aYm2413a Posts: 630
    edited 2008-04-20 19:33
    I never have been able to find larger serial SRAM's either.
    Most of the larger SRAM's (64k or bigger) are of parallel interface. (Address bus + Data bus + W/R + CE)

    I have used some Cypress Async SRAM's before with FPGA's. They worked wonders and are 3.3 volts. [noparse]:)[/noparse]

    Thanks everyone!
    --Andrew Arsenault.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Share the knowledge: propeller.wikispaces.com
    Lets make some music: www.andrewarsenault.com/hss

  • hinvhinv Posts: 1,253
    edited 2008-04-20 21:23
    How about this 2Mb fram?
    http://www.ramtron.com/products/nonvolatile-memory/serial-product.aspx?id=100
    It runs at 40MHz SPI @ 3.3V.
    It looks like it would have to be dune on a smt skillet though.
    Anybody used this package before?
  • vampyrevampyre Posts: 146
    edited 2008-04-21 00:46
    man, FRAM is cool. trillions of write cycles, serial access, i so can't wait till i can use SMT.

    after spending a bit of time searching/reading/thinking, it I'm starting to realize you guys were right about DRAM, i'm looking into how to use it now. thanks again for all the feedback and ideas.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-21 01:00
    One difference between EEPROMs and FRAM that's not well publicized is that FRAM reads are destructive. The chip takes care of writing the data back into the array, but each read cycle counts as a write cycle in terms of lifetime. In the case of EEPROMs, reads are non-destructive. If you're doing a lot of reads and only a few writes, EEPROMs are still better because of this.
  • hinvhinv Posts: 1,253
    edited 2008-04-21 02:00
    That is interesting, if you used it as a frame buffer, and read it 60 times/second it would last 528.5 years if I did my math right.
    Of course, that is assuming that you don't actually change the frame buffer. If you changed half of the contents of the frame buffer you would still get 396 years or so.
    I don't think that number of writes is a real issue there, unless the writes get slower like in the case of eeprom.
    Speaking of speed, I don't know if a descent amount of it could be used for frame buffer because of the SPI interface.

    I can see FRAM being used like swap space for Extended Large Memory Model, but at 5MB/second theoretical limit, I don't know if it can be used for that either.

    Mike, what is the fastest you have gotten reads or writes on the propeller?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-21 02:38
    I didn't do an accurate timing test, but the 400kHz I2C clock timing wasn't 100% reliable. A good guess would be 250kHz to 300kHz which would be about 25-30kbyte/sec for reading and 15-20kbyte/sec for writing.
  • jazzedjazzed Posts: 11,803
    edited 2008-04-21 15:11
    I've built a 1MB prototype in this configuration with a SIMM socket. Board still boots·[noparse]:)[/noparse]

    ·31 - ·· Serial IO RX (keep as input after boot)
    ·30 - ·· Serial IO TX and SIMM WE_
    ·29 - ·· SEEPROM SDA· (keep as input after boot?)
    ·28 - ·· SEEPROM SCL· and ALE
    ·26 - 27 Keyboard
    ·24 - 25 Mouse
    ·16 - 23 Protoboard VGA
    ·12 - 15 MicroSD Card (reserved ... not yet added)
    ·11 -··· SIMM CAS_
    ·10 -··· SIMM RAS_
    ·8· - 9· SIMM A0..A1· (for burst modes)
    ·0· - 7· SIMM D0..D7 & A2..A9 (use ALE)

    I'm thinking that native·PASM would give 4 byte read access for LMM instruction fetch in less than 2us.

    I'll post results later if·this doesn't·make me burnout first.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley

    Traffic is slow at times, but Parallax orders·always get here fast 8)
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-22 00:14
    Using an FPGA or CPLD is the most versatile means for providing all the pinouts for interfacing with SRAM. Transparent latches are a tried and true method. I have always had a soft spot for the counter approach. Using 74HC163 which is a 4 bit up counter with parallel load capability and daisy chaining the terminal count pin to the count pin of the next stage, they can be operated like a transparent latch by parallel loading the value (typically updating 2 at a time as an 8 bit quantity). But for successive addresses all you need to do is toggle the count pin and the address is incremented by 1. The only drawback with this is you need twice as many chips as with the transparent latch technique, but they are·quite cheap so it's really a question of board space.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 4/22/2008 12:19:49 AM GMT
  • Ym2413aYm2413a Posts: 630
    edited 2008-04-22 10:11
    One thing I would like to add about the FRAM chips is that they only last for about 10 years.
    I don't know if this would be a problem or not for some people, but it doesn't seem like a very long time for a IC.

    Some of us here have old computers and chips in our collection that are already over 3 times that in age.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Share the knowledge: propeller.wikispaces.com
    Lets make some music: www.andrewarsenault.com/hss

  • hinvhinv Posts: 1,253
    edited 2008-04-22 11:03
    jazzed: correct me if I am missing something, but your list shows only A0..A9 a total of 10 address bits, totaling an address space of 1KB, not 1MB. Are the upper address bits multiplexed in there also?
  • hinvhinv Posts: 1,253
    edited 2008-04-23 16:08
    Well, I figured it out. that's 10 address bits for row, and another 10 for column.
  • jazzedjazzed Posts: 11,803
    edited 2008-04-23 16:50
    hinv,

    Sorry I didn't answer you promptly, was busy. Yes,·A0..9·= 10 bits; using DRAM·RAS/CAS mux = 20 bits.

    Alas, total cycle times are worse than I hoped by about 3x but some attributed to cmd/data interface and if-else-if-else construct; A 32bit read cycle is actually about 5.5us. Updated version 32bit access is about 3.8us.

    ·31 - ·· Serial IO RX
    ·30 - ·· Serial IO TX and SIMM WE_
    ·29 - ·· SEEPROM SDA
    ·28 - ·· SEEPROM SCL· and ALE
    ·26 - 27 Keyboard
    ·24 - 25 Mouse
    ·16 - 23 Protoboard VGA
    ·12 - 15 MicroSD Card
    ·11 -··· SIMM CAS_
    ·10 -··· SIMM RAS_
    ·0· - 9· SIMM D0..D7 & A0..A9 (use ALE)


    The resistor values between Propeller and DBUS (input of 74LS377 and DRAM) should be 1K.
    Since the DBUS "latch" is actually an 8-bit D flip-flop ALE's positive transition and not the level set's the address.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley

    Traffic is slow at times, but Parallax orders·always get here fast 8)

    Post Edited (jazzed) : 4/27/2008 3:11:29 AM GMT
  • hinvhinv Posts: 1,253
    edited 2008-04-23 20:37
    jazzed,

    After a bit of snooping, I found out that most dram newer than EDO is 5V. I thought that would be a poblem since you have bidirectional lines. I guess that I have to do some more checking on how to do that. Do you have a schematic? What parts are you using?
  • jazzedjazzed Posts: 11,803
    edited 2008-04-24 00:49
    hinv said...
    jazzed,

    After a bit of snooping, I found out that most dram newer than EDO is 5V. I thought that would be a poblem since you have bidirectional lines. I guess that I have to do some more checking on how to do that. Do you have a schematic? What parts are you using?
    Don't want to hijack this thread. I'm thinking I should PM details other than what I'm providing in this post (schematic is TBD). I'd rather not post too much here. The last "public" design left a wierd after-taste. The "netlist" is in the previous post. The DRAM is TC511000AJ-70 or equivalent (very old page mode stuff). If you or anyone else PM's me on this subject, I'll send other materials and a schematic if possible.

    BTW I put 2.2KOhm resistors on the bi-directional lines and the bottom comes up a little, but the data is fine. The driver is still prototype phase and I'm debugging it. I'll post the final version publicly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    jazzed·... about·living in·http://en.wikipedia.org/wiki/Silicon_Valley

    Traffic is slow at times, but Parallax orders·always get here fast 8)
Sign In or Register to comment.