More Memory for Code..?
Jim the Hermit
Posts: 79
in Accessories
A while ago I bought the (#32312) Micro SD Card adapter after (I think) reading about how it could be used for data logging and for executing spin programs. But, I can't seem to find it anymore. And there's not a whole lot of info on OBEX. Prop can execute code written on a SD card, right?
Comments
For documentation, look at <learn.parallax.com>. The Propeller Board of Education and the Propeller Activity Board both have micro SD card sockets on the boards and you can wire your adapter to pretty much any set of 4 I/O pins the same way. If you want, just look at the schematic for either board and wire up your adapter the same way.
But the programs themselves are limited to the ROM on the propeller, right (32k)?
Correct. PASM code runs within the COG RAM whle SPIN code runs from the shared 32K RAM. The Kiosk application I refer to would bootstrap 32K images from the SD card.
I'd be interested to see that code thanks
Dave
First, ROM is Read Only Memory. Filled with content at the time the chip is made. You are not able to change it.
Program execution uses RAM, Random access memory. the P1 has 32KB shared (Hub)-RAM and each COG has its own 2KB of RAM to execute code.
As pointed out you can use the SD card to load different spin programs, but a single program still is bound to 32KB in spin.
PropGCC the C/C++ compiler for the P1 can use virtual memory (either SD card or external spi ram or bigger eeproms) so you are able to run larger programs as will fit into the 32KB of hub memory.
The upcoming P2 chip will have 512KB of ram, so has way less restrictions on code size - but - is not there yet.
Enjoy!
Mike
Having a look
Dave
that would be also a way to run larger spin programs with propgcc
Enjoy!
Mike
I quickly ran out of space on the BS2. I don't think 32k is enough for what I want to do (I'm trying to build a robot pet), but I plan on using 2 props because I need more I/O pins. 512k is better, but a meg or two would put my mind at ease.
I was hoping the prop could use the sd card for program memory, but it doesn't work that way.
BTW
The prop can play wav's from the card, could it record them to it in the adapter as well? (with additional recording components)
If you get much beyond a couple of Spin programs, you're better off using an SD card or serial Flash chip. There is a simple serial Flash driver in the OBEX that can load and execute Spin programs as well as reading and writing named files and there's a simple wear levelling algorithm used (not so good but better than none).
Large Spin is possible via spin2cpp and XMM. Not very practical but interesting. I just tested XMM on a C3 board successful, never got that Parallax Memory card to work on my other boards I have.
Since I prefer SPIN over C/C++ I never investigated it further what other external Memories PropGCC supports. But I remember there is support for bigger EEPROMS, SD-Card and SPI Ram.
Sure it is slower and I guess you are still restricted by Hub space for variables and needed buffers, but there is support for larger C/C++ programs as would fit into 32KB.
Sadly Parallax has no Board sold with extra RAM to set up some standard to use it except the C3, having that curious SPI select schema.
So the PropGCC guys did their part of the work, but no HW was provided and interest got lost, I guess.
Hopefully the P2 will solve the SPIN size restriction, but I still think it would be nice to have native SPIN byte code running in a virtual memory space.
A couple of people here made custom SPIN interpreters, using some HUB ram to extend the available size for the interpreter. I am sadly to stupid to do things like that or do not have the time to dig deeper into the interpreter source, Chips code is somehow overwhelming.
But if all (most?) HUB access of the interpreter would be redirected to some memory-cache-driver for external SPI RAM or whatever PropGCC already has, then SPIN could grow quite big.
Basically all modules are able to be relocated already, sadly @Chip used 16bit(?not sure?) pointers, there are some old threads about this.
Maybe the HyperRam efforts will bring some approachable way to standardize things.
Enjoy!
Mike
Rev A, apparently.
Wait a minute, the spin language is built with a limit of 32k??? Running multiple programs is completely useless to me. I would like to experiment with a software based neural network (or at least try)
There is 8 cores with space for 512 LONGS (32 bits) of instructions and data each.
If that is not enough for what you want to do it really is time to look for something else. Like an ST32 F4. Or whatever.