Shop OBEX P1 Docs P2 Docs Learn Events
Softloader examples — Parallax Forums

Softloader examples

Does anyone have a good example softloader object? I am looking to build a softloader that reads a .binary image from the upper 16K of the eeprom and executes it on the prop.

I'm just looking for an example, the heavy lifting of loading the image and such, I can build myself.

Thanks guys,
--Terry

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2016-03-15 03:17
    The sdspiFemto.spin object that's part of FemtoBasic is a low-level SD card and I2C (EEPROM) driver that can load and execute a binary image from anywhere in EEPROM as well as from a FAT16 SD card file. The Spin interface to the PASM driver assumes that a 32K binary file is to be loaded, but the interface routine (bootEEPROM) can be modified to load a shorter binary file. The PASM driver read routine is used with special options for loading and starting a Spin program. Look in the Object Exchange.
  • Mike, sorry to take so long to reply. I just now have had time to look into the details of the object. This is exactly what I need. I was wondering if you or someone could help describe the mailbox that is used to communicate with the object once it is started.

    It appears there are two longs in hub RAM that are used as the mailbox. These are my interpretations of how those longs are utilized for reading and writing.

    The upper 8 bits of [control][0] appear to be the command register.
    The lower 24 bits of [control][0] appear to be the EEPROM address register. I am unsure how bits 17-24 are utilized here.
    The upper 16 bits of [control][1] appear to be the number of bytes to read/write.
    The lower 16 bits of [control][1] appear to be the address in hub RAM you are reading/writing to.

    It appears that if long[control][0] bits 25 - 29 are low, you can read or write commands to the mailbox.

    Does this sound correct? I want to implement writeEEPROM in PASM for my project. I just can't grok the mailbox registers fully.

    Thanks in advance.

    --Terry


Sign In or Register to comment.