Shop OBEX P1 Docs P2 Docs Learn Events
SX48 and PC RAM? — Parallax Forums

SX48 and PC RAM?

ElectronegativityElectronegativity Posts: 311
edited 2006-02-27 15:53 in General Discussion
Has anyone tried to use PC RAM (like 30 pin SIMM) with an SX48?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I wonder if this wire is hot...

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-24 15:38
    I'm sure it could be done, but this type of RAM is dynamic and requires refreshing.· That means that you need to keep accessing the memory (every cell) every so many ms or the data is lost.· That is the big hang-up of using DRAM on microcontrollers.· SRAM is always a better choice in terms of ease of use although slightly more money.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-02-24 15:42
    Thanks Chris, I'll stick with the SRAM then.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • David BDavid B Posts: 592
    edited 2006-02-24 19:07
    Yes, I did this with an SX52 board.

    It was surprisingly easy. I'd been worried about satisfying the refresh requirements, but as I was using RTCC-controlled interrupts anyway for RS232 communication, I was able to just stick a refresh command into the ISR and it worked like a champ.

    Here's some code. I was developing a bike speedometer/heartbeat sensor at the time, so you'll see lots of semi-developed code for those things. But the dynamic RAM and the RS232 ISR parts were working perfectly.

    David
  • BeanBean Posts: 8,129
    edited 2006-02-24 19:44
    Very cool David.
    Did you use a 30-pin simm or just regualar ic ?
    How much power did the RAM require ?
    Just wondering.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    "Ability may get you to the top, but it takes character to keep you there."
    ·
  • David BDavid B Posts: 592
    edited 2006-02-24 20:13
    I did this quite a few months ago, and don't remember many of the details. I don't remember ever measuring the current draw.

    I used a SIMM and socket from an old motherboard I had in the garage, fastening the socket to an extension I attached to the side of the SX52 experiment board.

    This was mostly an educational experience, to learn about using dynamic RAMs, and to test whether DRAMs might be a worthwhile way to go in a logger, since I already have a few dozen SIMMs sitting around the garage.

    It seemed to work just fine. The DRAM performed exactly as some document I'd found said they would, as soon as I found the magic number of delays to stick into various places. I haven't used it in any serious logger, but don't see any reason it wouldn't work just fine.

    I don't think this version of the code shows it (I had attached the only version I happened to have on my work computer) but I had a version of the code where a PC could send data to any selected DRAM address (up to one megabyte, my SIMM size), then read it back to test the RAM.
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-02-24 20:26
    Very cool, Maybe I'll give it a try with some stuff from my junk box.

    Unfortunately I think I used all my old motherboards as shotgun targets.

    Do you know where I can find an application note with timings and such?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • David BDavid B Posts: 592
    edited 2006-02-24 20:55
    Shotgun targets?

    When I get home tonight I'll look for the document I used and send it along.

    Although I used the SX52, the SX48 should work identically, since both have the same ports C, D and E.

    Bean, I neglected to say that I did use a 30 pin SIMM.

    Actually, I wired in a dual-SIMM socket, so the circuit should be able to use two SIMMs, with chipselect managed by the column address strobe "CAS" (which is why it's labeled CAS_1 in the code) for up to 32 megs of storage. But I only tested it with a single 1-meg SIMM.
  • James NewtonJames Newton Posts: 329
    edited 2006-02-24 20:59
    David, that is REALLY cool! I hope its ok, I've added a page at sxlist.com:

    http://www.sxlist.com/sx52logger.htm

    If you find a more up to date version of the code, I'd love to update it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • ElectronegativityElectronegativity Posts: 311
    edited 2006-02-24 22:06
    I am truly impressed at the commenting!

    Puts my code to shame.

    This looks really good, especially since I was thinking of using an LCD display and you seem to have implemented that as well.

    Thanks David.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • Clock LoopClock Loop Posts: 2,069
    edited 2006-02-24 23:46
    Neat.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Meh. Nothing here, move along.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-25 05:10
    David,

    ·· Yes I should've mentioned using interrupts to maintain refresh.· That's how it was done with the Z80 back when I studied that myself.· I didn't think anyone had really messed around with it on an SX though.· Refreshing to see something new and thought to be too difficult to bother with.· Nice work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • David BDavid B Posts: 592
    edited 2006-02-27 04:51
    Thanks for all the kind words!

    In the project section, I've posted a project with a picture of my board, more recent code and a few documents.

    The code listed above was an old development piece. For the project, I cleaned it up a bit and doublechecked that the RAM, the RS232 for the PC two-way communication and the RS232 for the LCD display all work properly.

    James, the code attached to the project might be better for the SXLIST site, and you're welcome to post it.

    I include a few references that helped - the SIMM socket pinout and a sample of code that shows the usage of each pin and gives examples of how to access the DRAM.

    Chris, I also used the Z80 quite a bit in years past, and I remember its built-in refresh support. It supported a refresh mode where actual addresses were provided to the RAM, which led me to think that refresh would be a complicated procedure. But then I learned that modern SIMMs have a refresh mode where a counter internal to the DRAM chips manages all addressing, so all we need to do nowadays is toggle a couple of SIMM control lines on every ISR, and we're done.

    This was a fun little project, especially because it worked so well, so quickly, even while using surplus parts.

    David
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-27 15:53
    David,

    ·· I remember doing a college project on the refresh for Z80, but not on a PC Memory Module, instead using 8 DRAM chips which were 1K X 8.· In any event when I started making my own boards I used SRAM.· More expensive, but a lot less complex and you could even get a Dallas version with battery backup.· But I do remember the DRAM Refresh thing.· You are bringing back memories of details I forgot.· I had thought we used an interrupt to handle it, but now that you mention it...In my own boards NMI was used for the watchdog and the IRQ line was used to update an RTC.· Amazing how many chips I went from down to a BASIC Stamp Module and a few misc chips.· Anyway thanks for providing all that information.· The more ambitious SX'ers will be able to turn that into some cheap mass storage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.