PDA

View Full Version : 2 Programs?



ProcessingData...
07-03-2009, 08:01 AM
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


ˇ

Microcontrolled
07-03-2009, 08:42 AM
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...
07-03-2009, 09:16 AM
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


ˇ

BradC
07-03-2009, 09:22 AM
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!

localroger
07-03-2009, 09:22 AM
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...
07-03-2009, 09:26 AM
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...
07-03-2009, 11:09 AM
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


ˇ

BradC
07-03-2009, 11:19 AM
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!

mctrivia
07-03-2009, 12:51 PM
My Boot Loader. Loads code from sd card to top half of 512kbit EEPROM then loads to hub ram (http://obex.parallax.com/objects/473/)

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 (http://propmodule.com/?x=products). PCB available for $5

Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd (http://www.gadgetgangster.com/160) and propmod-1x1 (http://www.gadgetgangster.com/161) 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 (http://uploader.propmodule.com) for free.

Nick Mueller
07-03-2009, 08:15 PM
Just saw that. Had no time to read. http://forums.parallax.com/images/smilies/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 (http://www.yadro.de)

Post Edited (Nick Mueller) : 7/3/2009 12:22:26 PM GMT

Microcontrolled
07-04-2009, 05:20 AM
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 Mueller
07-04-2009, 05:41 AM
> 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. http://forums.parallax.com/images/smilies/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 (http://www.yadro.de)

Post Edited (Nick Mueller) : 7/3/2009 10:17:33 PM GMT