Shop OBEX P1 Docs P2 Docs Learn Events
SRAM/flash expansion... — Parallax Forums

SRAM/flash expansion...

ImageCraftImageCraft Posts: 348
edited 2008-07-21 15:02 in Propeller 1
I suspect Andrea may have done it already for the Hydra, but I am not familiar with the Hydra system yet. Anyway, perhaps you kind folks have the answer: what does it take to interface 64K or above SRAM / fast flash to a Propeller and do it as fast as possible? SPI/I2C is too slow.

Thing is if it is fast enough, it's just as easy to use the external mem for LMM C program storage, then the bulk of the 32K can be used for data memory, and if one were to solve the (read) contention issue, especially in the general case of multi-Propeller access, then it would be perfect. A "low-end" 128K program memory, 32K data memory, 8 core Propeller system would just rock.

Credit goes to Bob Racko for the idea, whom I met again after 15+ years.

So many ideas, so little time... smile.gif

Comments

  • heaterheater Posts: 3,370
    edited 2008-07-18 05:27
    Isn't the Propeller Lock mechanism the best way to solve the contention issue ?
    I'd like a good external RAM solution as well, for all or part of my 8080- CP/M emulator RAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • ImageCraftImageCraft Posts: 348
    edited 2008-07-18 05:51
    heater said...
    Isn't the Propeller Lock mechanism the best way to solve the contention issue ?
    I'd like a good external RAM solution as well, for all or part of my 8080- CP/M emulator RAM.

    Too slow, you want a HW solution. Also, it won't work for multi-prop system.
  • TimmooreTimmoore Posts: 1,031
    edited 2008-07-18 05:55
    There are a number of ways to do it, they all have to solve the no of pins problem. Here are 3 ways I can think of.
    1. Same way as Hydra, cpld to provide address indexing so you dont need pins for addressing. Looking at the driver for this card it takes 9 instructions per byte to read/write to the card. Though I thinking using counters could speed this up. The card uses 11 pins for 512K bytes
    2. Use something like al440b which is a fifo but has an interface similar to I2C to set the start read/write addresses, so again you dont need pins for addresses. This has separate read and write pins so in principal you can read and write can the same time. I use them as an interface between a camera and the prop. I think you could also use them as a video output. You connect the write data pins to the prop, the read data pins to a resistor DAC and clock the read from a prop counter and you have a video system. If you use a counter to clock the write clock them you can use 1 instruction to read and byte and another to store it. So 8 instructions per long. This chip would take 12 pins for a fast read/write ram of 512Kbytes
    3. The spi-sram that oldbitcollector found. Those are fairly fast you can clock them at 20Mhz. To get really fast you still need to parallel them, if you put 4 in parallel I believe you can access them in 30 instructions per long, with 8 in parallel its 14 instructions per long. It supports auto-addressing incrementing so you can burst large amounts in/out. For a 4 ram wide you use 6 pins for 128K bytes.
  • VIRANDVIRAND Posts: 656
    edited 2008-07-18 05:55
    Maybe use an oldschool SRAM, but you trade lots of pins for the speed.
    ee.usc.edu/library/ee459/datasheets/628128.pdf
  • heaterheater Posts: 3,370
    edited 2008-07-18 06:30
    ImageCraft said...
    Too slow, you want a HW solution. Also, it won't work for multi-prop system.

    Aren't there a number of different contention problems here:

    1) Multiple COGs reading /writing a single byte (or whatever word size)
    2) Multiple COGs reading/writing multi word array/structure
    3) As 1 but with more than one Propeller
    4) A 2 but with more than one Propeller

    Solutions to 1) traditionally would use a dual port RAM but in this case we need 8 ported RAM !
    2) Requires some kind of lock facility for mutual exclusion of processes. Just now I can't see any external lock mechanism being faster than the internal Propeller locks.

    3) and 4) with multiple Propellers needs external hardware help probably from a CPLD or FPGA.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • jazzedjazzed Posts: 11,803
    edited 2008-07-18 07:01
    Perhaps you are considering locating .text above 0xffff for LMM PC fetch from Flash? Having .text mapped to Flash space would simplify many things.

    A 128K word-wide address latched SRAM/Flash could be done with the addition of two 74LS374 chips, but there would be little I/O left for other devices. You might be able to squeeze in TV DAC + SDIO interface or VGA, but that's about it.

    Based on experience with my 1MB DRAM project, it seems an address latched SRAM might get about 3MB+ per second. Flash read access performance would be the same (writes are different of course). My DRAM project performance is about 1MB per second and requires about 3x the instructions of an address latched SRAM.

    Higher density RAM can be had with DRAM with one 74LS374 and less propeller pins, but will be much slower than address latched SRAM without a complicated hardware assist. My protoboard has a 1M DRAM, but the only thing I've done with it so far is test that it works. I'm using a COG MMU controller written in PASM that could be easily included in a C library.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • AleAle Posts: 2,363
    edited 2008-07-18 07:42
    Jazzed what you have done is great wink.gif. With such a DRAM (DRAM read is a bit.. slow [noparse]:)[/noparse] you may want to tackle on the emulation of the 6502 we talked about some time ago ! As soon as I build my SRAM/Prop boards (I got the PCBs some weeks ago) I'd try also. Do you mind posting a schematic and code for the DRAM. I know is trivial I just wanted to compare with what I thought if I can find my notes...
  • jazzedjazzed Posts: 11,803
    edited 2008-07-18 08:16
    Ale said...
    Do you mind posting a schematic and code for the DRAM.
    Ale, I never did enter a schematic, but the pin-out I used is in the attached .spin file.
    Using TV instead of VGA would allow more flexibility especially regarding pins 28 & 30.
    My 6502·asm book has disappeared cry.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • AleAle Posts: 2,363
    edited 2008-07-18 11:38
    I think the original (I admit it: scanned!) manuals from MOS are available in pdf from... 6502.org ? well, something can still be obtained!

    Edit: This is the schematic of the circuit i built (well just the pcbs I got)
    The SRAM is a BS62LV1024 in TSOPII package. The board is the other image smile.gif

    Post Edited (Ale) : 7/18/2008 1:43:10 PM GMT
    1204 x 756 - 22K
    984 x 723 - 69K
  • hippyhippy Posts: 1,981
    edited 2008-07-18 13:56
    It's always a compromise between I/O pin usage and speed, I/O needed for application and that dedicated to system peripherals.

    A side issue but important is that if it gets complex or costly, is it worth doing, would the target audience simply choose some other hardware platform in the first place or an alternative solution ?

    I'd look at high-speed SPI memory first as the all-round easiest solution but I admit it depends on what need one is trying to address. Those who want to use C rather than Spin would probably accept some loss of performance set against being able to use C, those who want C with performance as close to native PASM as possible would perhaps be less accepting.

    Many people have used pre-programmed micros which could be said to have truly atrocious performance which they are entirely happy with so speed may not be as much a problem as it is sometimes perceived to be. It of course depends on application.
  • jazzedjazzed Posts: 11,803
    edited 2008-07-18 18:06
    It's hard to find the sweet spot without very specific goals in mind. Clearly there are possibilities though.

    Ale, that's a tight real-estate board. Using byte-wide SRAM helps to avoid "byte-lane" problems and reduces
    the overal footprint. Will you post example code and performance measurements later?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • AleAle Posts: 2,363
    edited 2008-07-18 19:47
    As soon as I build and test them yes smile.gif. I'm a bit... miffed from some strange behaviour I have seen from the propeller (with other 2 boards I've done) when booting.. PA15 to PA13 or so oscillate... very strange. I did not look at the source of the loader to see if it is remotely possible... probably a high impedance issue with the LA. As the title says that is a HP-71B ram expansion... let's see if it works as planned.
  • TimmooreTimmoore Posts: 1,031
    edited 2008-07-19 07:02
    I have just finished building a SRAM board based on SPI-SRAM chips. I use 4 in parallel using 6 pins (4 for data, clock and chip select). The peak rate is ~2.6Mbyte/sec with a 80MHz system·since I use 30 instructions per 4 bytes through the average is slower since there is overhead per burst. The burst size is 32 longs and it should manage this at 2.1Mbps. Its a pretty simple board 4 rams, 2 caps and 7 resistors. The attached file contains the board schematic and layout as well as the driver.
  • hippyhippy Posts: 1,981
    edited 2008-07-19 10:13
    One thing to bear in mind with these Ram solutions is that as it is ultimately going to be used for LMM-C program storage, that code has to be held elsewhere until the Propeller has booted. That will require additional Eeprom or other non-volatile storage.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-07-19 13:32
    @Timmoore

    Any chance you'll have a couple extra PCB's made? I'd love to buy one of them from you if you do.

    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
    Need a part? Got spare electronics? - The Electronics Exchange
  • jazzedjazzed Posts: 11,803
    edited 2008-07-19 14:34
    Excellent work Tim. An 8 chip solution may even beat SRAM performance. Since there
    is now apparently a reasonable connection-density-speed solution, it's time to make
    interfaces that will use it or any other.

    Hippy, the other media could be ethernet [noparse]:)[/noparse] You mentioned LMM; it is positioned to easily
    use this by doing fetch in the LMM loop. For all the spin lovers, that means having an
    interpreter or compiler that uses LMM .... What is the RAM interpreter status?

    For C, it's just a matter of adding a fetch interface to the kernel and having an entirely
    pasm interface for the SPI-SRAM. Putting "text" segment in external memory and leaving
    variable references for "bss/data" in Propeller's internal memory would offer a good
    solution since the data could be shared with pasm drivers. It's just a matter of fixing the
    program.cmd linker map, and adding a fetch loop call. Of course one does not need
    SPI-SRAM for this model, but a similar arrangement of SPI-EEPROM [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • hippyhippy Posts: 1,981
    edited 2008-07-19 15:12
    No idea of the RAM interpreter status. I've no doubt that the idea will work, I was just cautioning that Ram in itself doesn't solve the problem of program storage when the power is off.

    My own idea for a Propeller development board includes two 24AA1025's so I can have LMM programs up to 64K-longs in size. But I'm not particularly worried about poor performance.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2008-07-19 15:42
    I've had my eye on the Ramtron ferromagnetic RAM for some time. In particular, the www.ramtron.com/products/nonvolatile-memory/serial-product.aspx?id=11 for starters. Solves the volatility and speed issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • TimmooreTimmoore Posts: 1,031
    edited 2008-07-19 17:29
    The other case I have been thinking about is video. If the normal video buffer is a smaller few line buffer and a separate cog reads from the sram and updates the video bufer you can get much larger video displays. I thnk you need 8 in parallel to get enough speed though to allow a reasonable time to write to the sram as well as read it.

    @quantum, just looked at the fram and its the same pin out as the ram I used, except for the write protect pin which is NC for the SRAMs. So the same board with minor changes and same driver would work for them.

    @oldbitcollector, yes I have a spare board but a warning theres no silkscreen though I didn't find it a problem putting it together. Drop me a PM.
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-07-20 07:13
    @jazzed: I am working on a Spin·RamInterpreter based on Chips code, but with·increased performance. I am not sure if that is what you referred to with Hippy (he sent me his code).

    I have been out of town for 3 weeks so no progress. Now back and implementing the changes. Just finished adding a debugger so I can validate my code against Chip's. I am using a different method than Chip·- I don't have the code restrictions he had. Updates will be announced on the forum under the title "Spin Interpreter - Faster ???".
  • jazzedjazzed Posts: 11,803
    edited 2008-07-20 07:33
    @Cluso99 Yes, I remember you taking on this project; sorry that your user-id escaped me (I could see your ship against the sunset though).

    I look forward to the wonderful things that can be achieved by having the interpreter in your (or anyone else's) willing and good hands. A debugger will be very welcomed by most new-comers and mosty anyone wanting either good direct evidence that their design assumptions are correct or just trying to unravel a mess. I look forward to your results.

    Designing a way for fetching byte-codes from external memory would be a good step for you or someone to take after an initial release. Users willing to take the step beyond the 32K restriction should appreciate such efforts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • hippyhippy Posts: 1,981
    edited 2008-07-20 13:59
    I'd certainly be interested in interpreting directly from I2C Eeprom / External Memory, if nothing else just to see what the performance difference was. I'm letting Cluso99 to do the hard part first smile.gif
  • PraxisPraxis Posts: 333
    edited 2008-07-20 20:32
    A PSD834F2V from ST might be suitable, you loose prop pins to interface it but you get them back as IO ports on the PSD device.

    The on board CPLD allows the RAM/Flash and IO to mapped anywhere in the device memory space

    FEATURES SUMMARY

    FLASH IN-SYSTEM PROGRAMMABLE (ISP) PERIPHERAL FOR 8-BIT MCUs
    3.3 V±10% SINGLE SUPPLY VOLTAGE
    2 MBIT OF PRIMARY FLASH MEMORY (8 UNIFORM SECTORS, 32K x 8)
    256 KBIT SECONDARY FLASH MEMORY (4 UNIFORM SECTORS)
    64 KBIT OF BATTERY-BACKED SRAM
    OVER 3,000 GATES OF PLD: DPLD and CPLD
    27 RECONFIGURABLE I/O PORTS
    ENHANCED JTAG SERIAL PORT
    PROGRAMMABLE POWER MANAGEMENT

    HIGH ENDURANCE:
    – 100,000 Erase/WRITE Cycles of Flash
    Memory
    – 1,000 Erase/WRITE Cycles of PLD

    Post Edited (Praxis) : 7/20/2008 9:01:02 PM GMT
    1009 x 734 - 71K
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-07-21 12:41
    Sorry, but please note the ST Microelectronics site says the PSD834F2V is NRND (not recommended for new designs). $20 from Digikey. 52 pin.

    http://www.st.com/stonline/products/literature/ds/8586/psd834f2v.htm
  • PraxisPraxis Posts: 333
    edited 2008-07-21 15:02
    Then the PSD835G2V-12UI.
Sign In or Register to comment.