Shop OBEX P1 Docs P2 Docs Learn Events
Memory in Propeller Programs — Parallax Forums

Memory in Propeller Programs

CrescendoCrescendo Posts: 4
edited 2012-03-22 10:36 in General Discussion
We are trying to store songs in our Propeller program. Right now, it seems that we are only able to store up to 5 songs. Is there any way to increase the memory of our microcontroller to accommodate more songs? Thank you so much.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-14 17:32
    You can't increase the Propeller's internal memory (32K hub and 2K per cog), but you can add all sorts of memory to the Propeller for data ... it's just not treated as an extension of the internal memory.

    For something like songs, the best thing to do would be to add an SD or micro-SD card. These are standard PC-compatible SD or micro-SD cards that can be read by or written to by your PC. There are several I/O driver objects in the Object Exchange that allow you to open files and read or write them from the Propeller. Have a look at FSRW and at Kye's. Also look at AN006.

    From a hardware perspective, you just need an SD or micro-SD card and a socket for it, a couple of 10K pull-up resistors, and a little bit of wiring. If you don't want to do that, there are some adapter boards that Parallax and others sell that have the socket and resistors and you just have to connect 4 wires to Propeller I/O pins, plus +3.3V and ground.

    You can even store programs in files on the card and there are loaders that can load and run a Propeller program from the card.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-14 19:52
    Crescendo wrote: »
    We are trying to store songs in our Propeller program. Right now, it seems that we are only able to store up to 5 songs. Is there any way to increase the memory of our microcontroller to accommodate more songs? Thank you so much.

    I agree with Mike, a SD card seems like it would be the easiest way of adding memory for songs.

    There are lots of other memory options as well (SRAM, Flash, EEPROM). In this case, I think all the other options would be harder to use than a SD card.

    What Propeller board are you using? Most boards I know have 64K EEPROM. Only 32K (or less) is used for the Propeller program. You might be able to store some extra songs in the upper 32K of your EEPROM. While this wont require extra hardware like the SD card, I think the software would likely be more difficult to write. I just thought I'd let you know about the option.

    What kind of format are these songs in? Are they a sequence of notes like the S2's GUI produces?
  • CrescendoCrescendo Posts: 4
    edited 2012-03-21 20:30
    Thanks for the advice!

    So we are using the Propeller Demo Board P8X32A-Q44 and the songs are midi files.

    We are going to look into Propeller boards with SD cards. Is there one you suggest?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-21 20:43
    The new (now shipping) Propeller Board of Education has a built-in micro-SD card socket as well as stereo audio output similar to the Demo Board. It has lots of other features as well. On the other hand, it's very easy to add an SD card or micro-SD card socket to any other Propeller board. It only takes 4 wires in addition to power and ground. If you have space on your Demo Board breadboard area and 4 pins free from those adjacent to the breadboard ares, it's a "piece of cake".

    Here's a micro-SD card socket adapter that can plug into the breadboard area of a Demo Board. Parallax also sells a full size SD card socket adapter.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-03-22 10:36
    There are a lot of SD card adapters on the market - some excellent and some not so good. Using one from Parallax is the simplest as there is a lot of support for it AND Parallax has included all the pull-up resistors for stabilty (many do not).
Sign In or Register to comment.