Shop OBEX P1 Docs P2 Docs Learn Events
2 Programs? — Parallax Forums

2 Programs?

ProcessingData...ProcessingData... Posts: 208
edited 2009-07-03 21:41 in Propeller 1
So if I understand the propeller EEPROM setup correctly, the spaces $00000 to $7FFFF are for program space? That means that $80000 to $FFFFF are free. So, could we not use a I2C Driver and one byte of variable space to switch the EEPROM sections back and forth? Essentially, creating a "second program" loadup option?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Basic Stamp,···· Propeller,·· · SX,·· FUN!


START:·
>Proccessing Data. . . .··
>Task Complete. . .·.
>Saving Data. . . .
>Entering SLEEP Mode. . . .
>Signing OFF


·

Comments

  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-07-03 00:42
    Wow, thats a good idea!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!· ···· Order 100 get 25 FREE!····· 200 left!!··


  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-07-03 01:16
    Yeah, I've been thiking about it. I'm going to write a demo program, and see how it goes. It should work!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • BradCBradC Posts: 2,601
    edited 2009-07-03 01:22
    To switch between programs, create a standalone cog that does this :
    - Stop all other cogs
    - Copy contents of desired eeprom segment to hub ram
    - Configure clock
    - Start spin interpreter on object at $10
    - Stop self

    Most of the code you require is in booter.spin posted by Chip quite a while back.
    It's dead easy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Missed it by ->" "<- that much!
  • localrogerlocalroger Posts: 3,452
    edited 2009-07-03 01:22
    PD, that's been done by several people; it requires that you use a 64K or larger EEPROM and the Prop was designed with a 32K chip in mind, which would be fully used with no extra space available. Unfortunately, the I2C protocol doesn't allow for you to distinguish between the two types (the higher bits are "don't cares") so if you wrote a protocol for a 64K EEPROM and used it with a 32K, you'd stomp the original with the 2nd program, and there's not really any way to tell you're doing that.
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-07-03 01:26
    Whoa! I just got a better Idea! okay, you build a program editor/compiler that stores the program in eeprom, the lower half.
    Then, when it's ready to be run, it moves the editor to the lower half, then puts the program into the upper half, and puts a small program that will flip the programs after its done running! of course, you have to account for loops, but you could make it put a bit in EEPROM that tells it to switch if the bit is a 1, and make it be a 1 when you first run the program!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-07-03 03:09
    Whoops! Looks like WHile I was typing my post, you two were typing yours.
    @BradC
    How do you start the spin interpreter at a position?
    Could you upload Booter.spin?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • BradCBradC Posts: 2,601
    edited 2009-07-03 03:19
    ProcessingData... said...
    Whoops! Looks like WHile I was typing my post, you two were typing yours.
    @BradC
    How do you start the spin interpreter at a position?
    Could you upload Booter.spin?

    Sure. Always keep a copy of interpreter.spin and booter.spin handy. They are the definitive guide on a lot of important aspects of the propeller.

    I've also attached a copy of a little demo I wrote a while back to demonstrate how to load a complete propeller binary into a new cog while the existing program keeps running. It's a good demo for how to start a spin interpreter wherever you want it. If you load it into the propeller RAM using F10, it will then load the contents of the eeprom bottom half at $388 and start the application there while it keeps itself running happily flashing a led on P7.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Missed it by ->" "<- that much!
  • mctriviamctrivia Posts: 3,772
    edited 2009-07-03 04:51
    My Boot Loader. Loads code from sd card to top half of 512kbit EEPROM then loads to hub ram

    I developed it with my propmodules in mind but I am working on a version 1.02 with more features and 1.03 should be generic along any platform with 512kbit EEPROM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-03 12:15
    Just saw that. Had no time to read. smile.gif
    Because since yesterday, I'm writing an EEPROM-read/write utilty. Exactly for the purpose of writing images to a different location in EEPROM.

    I've designed it that way, that it can be let run on the Prop on a console (command-line driven) or be remote controlled by a server on the PC.

    I think, I'll post the version tonight (European time).
    The server is not existent yet. But the client on the Prop is written that way, that a terminal program like RealTerm (that can playback files) is enough.

    As an teaser the commands:
    -?  Help screen
    // comment
    -v verbose on
    --v verbose off
    -p ping-pong on
    --p ping-pong off
    -a trailing address (for easier reading)
    --a switch '-a' off
    -d<DecOrHexOrBin> device address, defaults to boot EEPROM
    -r<DecOrHexOrBin>:<DecOrHexOrBin> read from Address n bytes
    -r<DecOrHexOrBin>:a read a bootable image (length autodetected)
    -w<DecOrHexOrBin>:<DecOrHexOrBin> write bytes to address, lenght
    -o: offset address (is handy for dumping)
    
    



    I'll explain that all in more detail in a new thread. Watch for "3PClient".

    This program is also excellent for poking around in the EEPROM.

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO

    Post Edited (Nick Mueller) : 7/3/2009 12:22:26 PM GMT
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-07-03 21:20
    Does this object allow the prop to load a new program into itself while running? Thats amazing!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!··········150 left!!··


  • Nick MuellerNick Mueller Posts: 815
    edited 2009-07-03 21:41
    > Does this object allow the prop to load a new program into itself while running? Thats amazing!

    No, just writing to the EEPROM.
    With this tool, you can write (and read) multiple boot-images to different locations.
    Normaly, no one needs it. But as soon as you have different images to boot from on a single EEPROM, its quite helpful.

    It's working now (wasn't satisfied with the speed). But need to change it for a different serial-port (I have two on my testboard and normaly use the non-default).
    Now, transmitting data at 115kBaud no longer saturates the in-buffer. Programming and verifying takes just a tad longer than Propellant, despite I transfer in Hex to make the output more readable for those who want to poke around.

    Drove me a bit nuts to effectively write in EEPROM-pages, until I came up with the idea to deqeue the writing. That's dumb simple now. smile.gif

    Will post it tomorrow evening, 'cause I have to visit the veterinair with both of my cats.

    And now for a beer ...
    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO

    Post Edited (Nick Mueller) : 7/3/2009 10:17:33 PM GMT
Sign In or Register to comment.