Shop OBEX P1 Docs P2 Docs Learn Events
Loading EEPROM file into RAM — Parallax Forums

Loading EEPROM file into RAM

iam7805iam7805 Posts: 14
edited 2006-08-07 23:04 in Propeller 1
Yo...

Here's what I want to do. I'm using this source for reading from an SD card. What I want to do is read an EEPROM file (exported from the Propeller tool) into RAM from the SD card. From my understanding, I can use the pgetc command to read the file byte by byte. But how do I load it directly into RAM?

Thanks,
iam7805

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-08-01 18:04
    You will probably have to do this in assembly since that's the only way to run a program while overwriting an existing one. If the programs you want to deal with are all short (maybe 16K bytes), you can read them into the high end of memory (and use an appropriate "_free=" declaration to check for enough space), then start up a small assembly routine (in the same COG as your spin program was using) that copies the program to location 0 where the SPIN interpreter expects it, then starts up the SPIN interpreter in the same COG again. Chip posted an example of starting up the SPIN interpreter from assembly.
  • iam7805iam7805 Posts: 14
    edited 2006-08-01 23:34
    Thanks, that is helpful.

    Heh, I was expecting that it would require some assembler.

    But how would I do this if I wanted to load a full 32kb program into RAM?
  • ciw1973ciw1973 Posts: 64
    edited 2006-08-02 22:47
    You would load a single COG with the relevant assembly code to read from the SD card and write to the main (shared) RAM.

    As assembly routines run completely self contained in the COGs, there's then no issue with completely replacing the entire contents of the shared memory.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2006-08-07 23:04
    hmmm, interesting concept for expanding program size/modes of opperation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Definetly a E3 (Electronics Engineer Extrodinare!)
    "I laugh in the face of imposible,... not because i know it all, ... but because I don't know well enough!"
Sign In or Register to comment.