Shop OBEX P1 Docs P2 Docs Learn Events
External Memory. — Parallax Forums

External Memory.

G3ek4EvurG3ek4Evur Posts: 10
edited 2011-05-20 15:02 in Propeller 1
Is it possible to add external memory to the propeller. Just more than 32K.

Comments

  • jazzedjazzed Posts: 11,803
    edited 2011-05-19 19:33
    G3ek4Evur wrote: »
    Is it possible to add external memory to the propeller. Just more than 32K.
    Sure. Depends on how big and fast you want it to be. What's your purpose for more memory?
  • G3ek4EvurG3ek4Evur Posts: 10
    edited 2011-05-19 19:35
    So I can wright larger programs.
  • jazzedjazzed Posts: 11,803
    edited 2011-05-19 19:41
    C language allows bigger programs. A version of basic that will be released soon allows bigger programs. We've done some experiments with a bigger Spin, but that hasn't worked out just yet.

    Do you have a language preference?
  • G3ek4EvurG3ek4Evur Posts: 10
    edited 2011-05-19 19:42
    C++ is my preferred language.
  • jazzedjazzed Posts: 11,803
    edited 2011-05-19 19:50
    G3ek4Evur wrote: »
    C++ is my preferred language.
    We have an "emulated" GCC tool chain now with C/C++, but it is quite slow.
    You can find it here: http://forums.parallax.com/showthread.php?129672-ZOG-GCC-C-C-Project-in-Google-Code-(propeller-zpu-vm)

    Parallax will make a decision whether or not to fully support a faster GCC for Propeller very soon.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-19 19:51
    That kind of external memory you can't add. It's impossible.

    That said, there are several emulators that run on the Propeller that can use external memory for their emulated memory. For example, there's a Z80 emulator that can use 64K or more of external memory for the Z80 program and runs standard CP/M (and MP/M) roughly at the speed of the original hardware. There's also a C compiler (Catalina) that uses one of several "memory models" for execution of an interpretive code based on the Propeller's native instruction set, but modified to execute out of either the 32K of built-in Propeller memory or external SRAM memory of different kinds. There's a time penalty for this and using the 32K of shared Propeller memory (hub) gets you an execution time of maybe 200ns for a 32 bit instruction vs. 50ns natively executing from the 512 long word cog memory. Executing from extern SRAM costs more overhead, perhaps comparable to the overhead for Spin's interpretive code (closer to 1us).
  • G3ek4EvurG3ek4Evur Posts: 10
    edited 2011-05-19 19:56
    Alright so is it a better idea to run multiple propellers than just one with external memory.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-19 20:03
    It all depends on what you're trying to accomplish (as always). If you're trying to provide a video output and some kind of large, computationally complex program, splitting tasks between two Propellers may be exactly what you need with one Propeller managing the video and the (large) video buffer and the other Propeller using overlays to manage the complex computations.
  • G3ek4EvurG3ek4Evur Posts: 10
    edited 2011-05-19 20:06
    Now to only problem i'am having is that I can not get the propellers to communicate with each other without taking up way to much memory, or it not communicating right.
  • jazzedjazzed Posts: 11,803
    edited 2011-05-19 20:19
    There are many things that can be done with the SPIN/PASM Propeller languages. It will take a little time to learn them.
  • G3ek4EvurG3ek4Evur Posts: 10
    edited 2011-05-19 20:22
    I have spent quite a few hours on the spin programming language, but i still do not understand PASM. I really never understood assembly language. Is PASM necessary for optimizing your program?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-19 20:23
    A number of people have already built multi-Propeller systems with several different ways of communicating back and forth. It certainly can be done. What and how depend on your particular needs and circumstances.

    You can complain about things not working out the way you want them or you can lay out your situation with details including commented source code and specific issues, what you've tried, what's worked and what hasn't, etc. and ask for advice.

    PASM is necessary for some parts of any program, particularly those parts requiring high speed and/or precise timing. For most applications, if you use an object from the Object Exchange, the PASM portion of the object is already done for you. Examples include FullDuplexSerial, various TV and VGA drivers, Servo32, and others. Whether you will need to write PASM depends on what you need to do and whether there are already objects that will do the job for you.
  • G3ek4EvurG3ek4Evur Posts: 10
    edited 2011-05-19 20:28
    Alright then what would be the best object to use in the case of 3 propellers. One controlling a datalogger. Another controlling servos, and motors, and the last one reading input from sensors.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-05-19 20:39
    C++ is my preferred language.

    If you are ok about using C89 then take a look at Catalina. There are lots of modules for the assembly already written, so you can talk to a keyboard, display, mouse, sd card etc from within C and not have to worry about the low level assembly drivers.

    I'm writing a GUI for the propeller in C, and it started off within the propeller 32k but rapidly grew to needing external memory. I'm using a 512k chip and the program is just under 200k at present. When the 512k chip gets too small, I'll switch to jazzed's 32Mb ram chip solution.

    So yes there are solutions here, but things are changing rapidly and not everything is totally easy to use. eg if you want to drive a servo, you might need to take an existing spin/pasm driver, strip out the spin part and rewrite it in C. I've done a few, and the more we do and share, the easier it gets.

    How big is your program likely to get?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-19 20:46
    Details are important. Servos, other motors, and a datalogger are all relatively modest tasks and could be done by a single Propeller unless there were details (not stated) that precluded that. Reading input from sensors could be easy or hard depending on the number of sensors, the types of sensors and how they're connected, etc. I can imagine such a system all done with one Propeller. I can also imagine needing two to four Propellers under some (unusual) circumstances. Look through the Object Exchange for objects matching what you need to do. If you want specific advice, you're going to have to supply a lot more detail.
  • jazzedjazzed Posts: 11,803
    edited 2011-05-19 21:00
    Dr_Acula wrote: »
    When the 512k chip gets too small, I'll switch to jazzed's 32Mb ram chip solution.
    If it's only code space you need SpinSocket-Flash can be had with a fast 10 pin Flash memory interface from 1MB to 4MB.

    BTW: Catalina does not support C++.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-05-20 15:02
    Dr_Acula has modified Kye's SD driver to make what he calls "Kye Dos."

    I've modified Kye Dos to use with a touchscreen project. I was running out of memory but with Kye Dos I could launch different programs depending on the menu selection.

    I think this is probably the easiest way of creating large "programs" on the Propeller. I also has limitations, one of which is not having all parts of a program available at once.

    There are various Prop to Prop communication protocols based on the needed speed and the number of pins available.

    BTW, I've found it helpful to have pull-up resistors on each line when using serial for Prop to Prop communication.

    Make sure and read the "Spin Zone" articles by JonnyMac. They helped me learn PASM (I have not learned any other assembly language).

    Duane
Sign In or Register to comment.