Shop OBEX P1 Docs P2 Docs Learn Events
Can the Propeller cogs simultaneously control two sources of RAM? — Parallax Forums

Can the Propeller cogs simultaneously control two sources of RAM?

DavidSmithDavidSmith Posts: 36
edited 2012-02-06 10:12 in Propeller 1
Couldn't find anything w forum search, sooooooo,

I want to record a continuous stream of data (approx 400,000 bytes/sec) - without interruption and AT THE SAME TIME (to retain an approximation of real time) read that data and process it.

Mechanically, it would work like a tape recorder set up for echo effect. As the tape moves, the first head writes and a short distance later (short time delay) the second head reads it and sends it on to processing (speaker for tape, in this case cpu).

I cannot simply process the input stream in real time as the processing will not be time linear (there's going to be jumping around in the data stream).

I could simply record and then process later, but I want fairly reasonable real time.

I think this could be done fairly easily w two Propellers, one writes then switches to read and the other reads and switches to write. However, can it be done w one Propeller? I think there's no problem w the cogs, they won't be asked to do much but record/read and the Parallax Product Catalog (nice catalog, by the way) is pretty clear the cogs must access on board RAM in rotation. But, would it be possible to have one cog accessing on board RAM and a second using USB mass storage or even a even a flash memory? How about TWO external USB or TWO external flash? to avoid high level conflicts w the onboard.

I want this to be a standalone oneoff and not connect to a laptop.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-02-05 18:00
    Yes, a single Propeller can do this, but you won't be able to use USB mass storage ... it's too slow. You're talking about a data rate of 1MB per second ... very achieveable using some kind of parallel SRAM or several serial SRAM chips in parallel or SDRAM. What you use depends on cost vs. amount of data involved. The Propeller's built-in memory can hold 32K bytes, both code and data. Eight 23K256 SRAM chips in series / parallel could handle 1/2 second of data at the rate needed and require maybe 16 I/O pins. An SDRAM could also handle the data rates and quantities involved.
  • DavidSmithDavidSmith Posts: 36
    edited 2012-02-05 18:35
    You just gave me an idea. Dual ported SRAM?
  • cavelambcavelamb Posts: 720
    edited 2012-02-05 18:53
    The propeller only has one set of I/O pins, which can be accessed by any cog.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-02-05 19:11
    Dual ported SRAM requires twice as many I/O pins to control and parallel SRAM (which you'd find for dual-ported SRAM) takes a lot of I/O pins depending on how big an SRAM you need. You'd need some kind of I/O expander to handle the address lines, preferably with an up-counter to allow for sequential access to the SRAM with low I/O pin count. You could also use serial SRAM to keep the pin count low. With the multiple cogs, you could certainly use one cog to write the data to some serial SRAM and another cog to read the data from the last batch saved and the two cogs could alternate. It all depends on how much memory you need and how the data is batched.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-02-05 20:14
    Mike Green wrote: »
    Eight 23K256 SRAM chips in series / parallel could handle 1/2 second of data at the rate needed and require maybe 16 I/O pins.

    @David,

    After hearing about using SRAM chips in parallel here on the forum, I decided to try it myself.

    Here's my version. I know others have done it better and faster. If you use the first eight pins of the Prop for the data lines, the transfer rates can be higher than using other pins.

    By sharing clock and chip select pins, the eight chips only use 10 Propeller pins.

    I also tried stacking the modules to give 32 SRAM chips using 13 Propeller pins. The chip select line would select which stack of chips to read to or write from.

    attachment.php?attachmentid=86068&d=1318953318

    The boards underneath the memory modules are a couple of Jazzed's TetraProp boards.
  • RaymanRayman Posts: 14,845
    edited 2012-02-06 10:12
    I think you could get close with SRAM and a 16 or 24-bit data bus. Our Flashpoint modules give a 4-bit SRAM bus. You could use several of them to create a wider data bus. You can then interleave writing and reading operations.
Sign In or Register to comment.