Shop OBEX P1 Docs P2 Docs Learn Events
Spin stamp loader — Parallax Forums

Spin stamp loader

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2009-06-20 13:22 in Propeller 1
The problem I have with the Prop IDE download to·a spin stamp
is that it always downloads the full 32kB.
I am thinking of writing a loader that uses P16-P18
(pins SOUT,SIN,ATN on the spinstamp), sacrificing
a cog to monitor/download, but only so much bytes
as the program occupies.
I realize I can only download to eeprom that way
but it will preserve the area beyond programsize
up to $7FFF.

Is there a fixed address that holds the programlength?
If not, I need to scan the program eeprom image
to find where the unused area starts.

Has anyone already written such an object?
(This object needs to be included with every program
for which I want to download via P16-P18).

regards peter

Comments

  • BradCBradC Posts: 2,601
    edited 2009-06-20 12:39
    What makes you think the IDE always downloads the entire 32K?

    <edit>
    Oh, you mean the Propeller always overwrites the entire eeprom? Yes, it does. No, nobody has written a compatible downloader for the prop yet but it's not difficult.

    Just grab Chips booter.spin code and change it to :
    a) monitor different pins
    b) only write to the eeprom as much as is downloaded
    c) ensure any program you download does not rely on the remainder of the memory space being zero
    d)..profit [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Missed it by ->" "<- that much!

    Post Edited (BradC) : 6/20/2009 12:44:32 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-20 12:48
    VBASE (a word at $0008) contains the program size in longs. This does not include the size of the variables (VAR) area nor the size of a 2 long stack marker. DBASE (a word at $000A) has the address just past the stack marker. The area between the stack marker and the end of the program is supposed to be cleared to zeroes.

    FemtoBasic's EEPROM/SDcard loader uses VBASE and DBASE. It only reads VBASE*4 bytes from either the EEPROM or an SDcard file. FemtoBasic's COPY statement uses VBASE to specify how much needs to be copied to/from EEPROM or an SDcard file.

    There have been some downloaders posted to the forum. I think one used XModem and another used YModem. The ROM bootloader (PNut) source has been posted and you could modify that to get you seamless compatibility from the PC side.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-06-20 13:22
    Mike,

    If I understand it correctly, the VAR area does not hold initializers (otherwise you
    would copy DBASE*4 bytes), and the DAT area proceeds the VAR area.

    Is that right?

    regards peter
Sign In or Register to comment.