command line interface
Archiver
Posts: 46,084
Hi group!
i am new to basic stamp. Is there a way to call basic stamp code from command
line interface, or call basic stamp code from a C program that uses
"createprocess()" to call programs? please help.
thanks,
amul
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
i am new to basic stamp. Is there a way to call basic stamp code from command
line interface, or call basic stamp code from a C program that uses
"createprocess()" to call programs? please help.
thanks,
amul
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
communicates with the Stamp via serial link. Remember, the BASIC Stamp
is an embedded processor so not all of our computer programming
experiences are applicable. On the other hand, you can use your own
editor and then pass your file to the BASIC Stamp compiler to be
compiled and downloaded.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=xgKc3wwkGC5CJtq7naUHli73JleGlJ1PozlGu6NSWufFXbRMHfTmklUxS8j5OExVb-NoALDL6rg]vimal222@y...[/url
Sent: Sunday, October 12, 2003 12:20 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] command line interface
Hi group!
i am new to basic stamp. Is there a way to call basic stamp code from
command line interface, or call basic stamp code from a C program that
uses "createprocess()" to call programs? please help.
thanks,
amul
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
call the basic stamp code from my C program?
thanks, amul
Jon Williams <jwilliams@p...> wrote:
No, not unless you create your own program to call that then
communicates with the Stamp via serial link. Remember, the BASIC Stamp
is an embedded processor so not all of our computer programming
experiences are applicable. On the other hand, you can use your own
editor and then pass your file to the BASIC Stamp compiler to be
compiled and downloaded.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=l41fITuFPtRmHwVUEFTJ3qv7rU3AEiQ8jkMU5ngd29XubB2H2x0ZNL7jsF_wqF1SaVWbdcHSrCywWA]vimal222@y...[/url
Sent: Sunday, October 12, 2003 12:20 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] command line interface
Hi group!
i am new to basic stamp. Is there a way to call basic stamp code from
command line interface, or call basic stamp code from a C program that
uses "createprocess()" to call programs? please help.
thanks,
amul
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
>thanks for ur reply. I am still a bit confused though. so how exactly
>would I call the basic stamp code from my C program?
>
>thanks, amul
Amul -
You can't call it per se, but you can interface WITH it via the serial ports.
Forget for a moment the language you're planning to use, and just look at
it as though the PC were communicating via its serial port with an external
device.
The external device just happens to be a Parallax Stamp Microprocessor running
the proprietary language PBASIC as provided by Parallax for the Stamp
Microprocessor.
I hope that helps to unravel the confusion and not make it worse.
Bruce Bates
that you're going to marry C to the BASIC Stamp is by creating a program
that sends commands to the BASIC Stamp via serial link (I've done this
with VB). The BASIC Stamp will interpret and act on those commands,
then send data back. To see how I did it in VB look here:
http://www.parallax.com/dl/docs/cols/nv/vol3/col/89.pdf
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=GcoTf_ge2wl7wUxqmkSIRV1nNW4wGwfBaB2Egi3t_Ckn6owLDWmDaCLglDgNz0jFZyIlgEip7u4]vimal222@y...[/url
Sent: Sunday, October 12, 2003 10:13 AM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] command line interface
thanks for ur reply. I am still a bit confused though. so how exactly
would I call the basic stamp code from my C program?
thanks, amul
Jon Williams <jwilliams@p...> wrote:
No, not unless you create your own program to call that then
communicates with the Stamp via serial link. Remember, the BASIC Stamp
is an embedded processor so not all of our computer programming
experiences are applicable. On the other hand, you can use your own
editor and then pass your file to the BASIC Stamp compiler to be
compiled and downloaded.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=GcoTf_ge2wl7wUxqmkSIRV1nNW4wGwfBaB2Egi3t_Ckn6owLDWmDaCLglDgNz0jFZyIlgEip7u4]vimal222@y...[/url
Sent: Sunday, October 12, 2003 12:20 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] command line interface
Hi group!
i am new to basic stamp. Is there a way to call basic stamp code from
command line interface, or call basic stamp code from a C program that
uses "createprocess()" to call programs? please help.
thanks,
amul
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
'C' routines.
2. If you WANT to pass data from your PC to the
Basic Stamp, you'll have to use an RS-232 port for
communication. This you can do. You'll have to
program the BS2 to 'Listen' on the port, and the
PC to 'Talk' on the port. Having 'Talked', the PC
must now 'Listen' for the response from the Stamp.
Having 'Listened', and gotten something from the
PC, the Stamp must now process it in some way,
and give a response 'Talk' back to the PC with the
results.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
<vimal222@y...> wrote:
> thanks for ur reply. I am still a bit confused though. so how
exactly would I call the basic stamp code from my C program?
>
> thanks, amul
>
> Jon Williams <jwilliams@p...> wrote:
> No, not unless you create your own program to call that then
> communicates with the Stamp via serial link. Remember, the BASIC
Stamp
> is an embedded processor so not all of our computer programming
> experiences are applicable. On the other hand, you can use your own
> editor and then pass your file to the BASIC Stamp compiler to be
> compiled and downloaded.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> Sent: Sunday, October 12, 2003 12:20 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] command line interface
>
>
> Hi group!
> i am new to basic stamp. Is there a way to call basic stamp code
from
> command line interface, or call basic stamp code from a C program
that
> uses "createprocess()" to call programs? please help.
>
> thanks,
> amul
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
directly from the command line or from within a C code? pls suggest.
thanks
--- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for
> communication. This you can do. You'll have to
> program the BS2 to 'Listen' on the port, and the
> PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> <vimal222@y...> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams <jwilliams@p...> wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C
program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
calling its internal code via the command line? You're wanting an
external piece of hardware to behave like a piece of software running
under the blanket of your OS -- it doesn't seem very logical. Please
help me understand.
The best you're going to get is to write a separate piece of software
that does accept command line parameters that then uses a serial (or
other _hard_) link to talk to the microcontroller.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: vimal222 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=wZ4s92EOggdwwLZw5Fct-gNg-KYFsdA16T6JXM2b4qFw27eXpBWrjGH_2hgpbkwLYzu86JFIH9ICsg]vimal222@y...[/url
Sent: Monday, October 20, 2003 12:07 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: command line interface
Does any other chip have this capability of calling its code
directly from the command line or from within a C code? pls suggest.
thanks
--- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for
> communication. This you can do. You'll have to
> program the BS2 to 'Listen' on the port, and the
> PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> <vimal222@y...> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams <jwilliams@p...> wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C
program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
is pretty good. Since you're not happy with
it, maybe we're not understanding what it is you
are looking for.
Please describe how the interaction you are
looking for would work. Would you just have
a library function like this?
int CallBS2(BS2DevType MyBS2, char * OutStr,
char * ReturnStr)
{
/* Send 'OutStr' to 'MyBS2' device. Get
a return string in 'ReturnStr' */
}
Is this right?
Or do you want:
> TalkBS2 "Hello"
Send this on the command line, and the
BS2 sends back "There".
--- In basicstamps@yahoogroups.com, "vimal222" <vimal222@y...> wrote:
> Does any other chip have this capability of calling its code
> directly from the command line or from within a C code? pls suggest.
>
> thanks
>
>
> --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
> wrote:
> > 1. No, you cannot 'call' basic stamp code from your
> > 'C' routines.
> >
> > 2. If you WANT to pass data from your PC to the
> > Basic Stamp, you'll have to use an RS-232 port for
> > communication. This you can do. You'll have to
> > program the BS2 to 'Listen' on the port, and the
> > PC to 'Talk' on the port. Having 'Talked', the PC
> > must now 'Listen' for the response from the Stamp.
> >
> > Having 'Listened', and gotten something from the
> > PC, the Stamp must now process it in some way,
> > and give a response 'Talk' back to the PC with the
> > results.
> >
> >
> > --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> > <vimal222@y...> wrote:
> > > thanks for ur reply. I am still a bit confused though. so how
> > exactly would I call the basic stamp code from my C program?
> > >
> > > thanks, amul
> > >
> > > Jon Williams <jwilliams@p...> wrote:
> > > No, not unless you create your own program to call that then
> > > communicates with the Stamp via serial link. Remember, the
BASIC
> > Stamp
> > > is an embedded processor so not all of our computer programming
> > > experiences are applicable. On the other hand, you can use your
> own
> > > editor and then pass your file to the BASIC Stamp compiler to be
> > > compiled and downloaded.
> > >
> > > -- Jon Williams
> > > -- Applications Engineer, Parallax
> > > -- Dallas Office
> > >
> > >
> > >
Original Message
> > > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > > Sent: Sunday, October 12, 2003 12:20 AM
> > > To: basicstamps@yahoogroups.com
> > > Subject: [noparse][[/noparse]basicstamps] command line interface
> > >
> > >
> > > Hi group!
> > > i am new to basic stamp. Is there a way to call basic stamp
code
> > from
> > > command line interface, or call basic stamp code from a C
> program
> > that
> > > uses "createprocess()" to call programs? please help.
> > >
> > > thanks,
> > > amul
> > >
> > >
> > >
> > > Do you Yahoo!?
> > > The New Yahoo! Shopping - with improved product search
> > >
> > > [noparse][[/noparse]Non-text portions of this message have been removed]
> > >
> > >
> > > To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > > from the same email address that you subscribed. Text in the
> Subject
> > > and Body of the message will be ignored.
> > >
> > >
> > > Your use of Yahoo! Groups is subject to
> > > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > > This message has been scanned by WebShield. Please report SPAM
to
> > > abuse@p...
> > >
> > >
> > > To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > > from the same email address that you subscribed. Text in the
> > Subject and Body of the message will be ignored.
> > >
> > >
> > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > > Do you Yahoo!?
> > > The New Yahoo! Shopping - with improved product search
> > >
> > > [noparse][[/noparse]Non-text portions of this message have been removed]
Is there a chip around for which i can call the code from command line without
having to go thro such details as we do for BS2?
pls suggest chips that have this functionality for i have come to see that
controller programming is possible only using the bundle that comes with the
chip. Is there any chip for which we dont need to press the 'go' button in the
environment, and instead call the code from either command line or from a C
program ?
thanks
amul
Allan Lane <allan.lane@h...> wrote:
1. No, you cannot 'call' basic stamp code from your
'C' routines.
2. If you WANT to pass data from your PC to the
Basic Stamp, you'll have to use an RS-232 port for
communication. This you can do. You'll have to
program the BS2 to 'Listen' on the port, and the
PC to 'Talk' on the port. Having 'Talked', the PC
must now 'Listen' for the response from the Stamp.
Having 'Listened', and gotten something from the
PC, the Stamp must now process it in some way,
and give a response 'Talk' back to the PC with the
results.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> thanks for ur reply. I am still a bit confused though. so how
exactly would I call the basic stamp code from my C program?
>
> thanks, amul
>
> Jon Williams wrote:
> No, not unless you create your own program to call that then
> communicates with the Stamp via serial link. Remember, the BASIC
Stamp
> is an embedded processor so not all of our computer programming
> experiences are applicable. On the other hand, you can use your own
> editor and then pass your file to the BASIC Stamp compiler to be
> compiled and downloaded.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> Sent: Sunday, October 12, 2003 12:20 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] command line interface
>
>
> Hi group!
> i am new to basic stamp. Is there a way to call basic stamp code
from
> command line interface, or call basic stamp code from a C program
that
> uses "createprocess()" to call programs? please help.
>
> thanks,
> amul
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
[noparse][[/noparse]...]
> Is there a chip around for which i can call the code from command
> line without having to go thro such details as we do for BS2?
>
Well, no -- but I'm not trying to avoid your question. It just needs a
little explanation to answer, and I can't be sure how much of this you
already know. So forgive me if I get too simple in this explanation.
Basically the Intel Pentium-whatever chip in your desktop will permit that.
And your Pentium chip has a command line interface, as well as an interface
to your C program, only because of the "bundle" that comes with the chip.
It's a pretty deep bundle in the case of the Pentium, starting with
microcode and reaching up through the BIOS to the operating system and
dozens of dynamic link libraries that are invoked by your C programs. Except
for the most primitive examples, this is the way all computers are
structured, in order that they can deliver a useful capability for people
other than their own designers.
When you want to talk to another chip while typing into the interface of
your Pentium, you're asking two computers to work together. That requires
additional software. Somehow, somewhere, all those details of the interface
have to be managed.
When we want two computers to cooperate, we need a set of rules about who
does what, and what information is exchanged to coordinate their respective
activities. We call that a "protocol." We have a lot of standard protocols
for accomplishing interfaces, and we tailor those standards for each
particular case. Your PC supports more interface standards than I care to
remember off the top of my head, let alone type. Some of the low speed
external interfaces are RS-232, USB, and the Centronics Parallel Port or
just "the parallel port" as most people say.
Neither the PC nor the Stamp, nor any other chip can talk across any of
those interfaces without both sides agreeing on details, and without
somebody writing software to negotiate those details and then pass the
information across the interface. The Stamp units come with that software
already installed on the board for you to use, just as the BIOS is installed
on your PC at the factory. Going to other chips without that software would
just make it more difficult for you, not easier.
It actually isn't terribly difficult to talk to a Stamp from the command
line, but you do have to have it connected to your PC to do that. The serial
port is the easy way, and the one we all use every day, so I'd recommend
that connection. For each command you want to send to the Stamp, you must
write code on the Stamp to carry out the function, but because of the
built-in software from Parallax, you can do that code in the relatively
simple Basic language instead of learning the details of a "machine
language" for a particular chip.
On the PC side of this cooperation, you must either write a small C program
to execute from the command line and pass the information to your Stamp over
the serial port, or you can use the built-in command language of the
operating system. It sounds like you already know how to write in C, so it
will be easier to write a small COM program for each instruction than it
would be for you to learn the command interface of DOS/Windows. It's
becoming harder every day to find anyone who knows there IS a command
interface, let alone somebody willing to teach you how to code it. So it's
probably simpler for you to write a little program for each instruction you
want to give the Stamp.
For example, if you want the stamp to control your lights, you could write
a program that runs from the command line, looking something like this:
LIGHTS BACKYARD ON
or
LIGHTS PORCH AUTO
Your C program will receive an argument list as a string array when the
operating system loads it and initiates execution. You're probably familiar
with the convention for passing arguments to a program from the command
line. The string array will look like LIGHTS\0BACKYARD\0ON\0 in the first
case, and LIGHTS\0PORCH\0AUTO\0 in the second case.
Your C code would translate those two argument lists into short byte
commands to pass to the Stamp. Perhaps "BACKYARD" means circuit 3, while
"PORCH" is circuit 1. If you have no more than 32 light circuits, you could
use five bits to specify which circuit and two bits to specify what you want
the Stamp to do. (Mode 0 could mean turn the circuit off, mode 1 means on,
and mode 2 could mean "use the light ambient level to decide whether to turn
the circuit on or off.") This simple interface only needs seven bits, and
you could transmit that to the stamp with a standard serial protocol in a
signal format that sends seven bits and then a parity bit. The parity bit
allows the receiver to perform a crude check on the data to make sure no bit
was corrupted in the transfer. That's so your Stamp does not receive a
command to turn off the refrigerator when you asked it to turn on the air
conditioner. Your C code will have to specify how many bits per second to
send, and a few other details. These will have to be the same details you
included when you wrote the code on the Stamp to receive commands.
That isn't a lot of interface design to have a command line interface to a
completely independent computer, and that's what the Stamp is. The only
thing that makes it that simple is the availability of the software bundles
that Parallax and Microsoft provide.
Perhaps you're picturing a need to have the Stamp editor running when you
transfer information from the PC to the Stamp. That isn't the case. You need
the editor to write the original programs for the Stamp (and to debug them
of course), but once that's done, the Stamp can lead a life of its own,
whether it's on a robot marching across a field or connected to your serial
port controlling your home lighting.
It's pretty easy to send the command data over the serial port from any
program -- or from the command line if you want to take time to learn how.
It's not practical to teach those techniques on this list, but part of the
"bundle" for the Stamp is an enormous number of applications described in
detail in books or on-line. At least three people who contribute here have
written books I've noticed in the month or so I've been interested in Basic
Stamps: Jon Williams, Al Williams, and Scott Edwards. I haven't seen him
contribute since I joined, but another good author is Matt Gilliland. I have
books by Jon, by Edwards, and by Gilliland, and they are very readable. Most
important, they are very specific and detailed about what you must do for a
particular project. Not much theory, but a lot of practical advice. Right
down to part numbers, wiring diagrams for circuits, and running code.
Offhand, I don't know which author would have a discussion of serial port
connections from your Stamp to your PC, but I'd bet Jon Williams has covered
it. Very possibly, all of them. I'm sure one of them will tell you where to
find the information.
Hope this helps,
Gary
> [noparse][[/noparse]...] part of the "bundle" for the Stamp is an enormous number of
> applications described in detail in books or on-line. At least three
> people who contribute here have written books I've noticed [noparse][[/noparse]...]
Oh yes, and Tracy Allen, who just posted on another topic. As far as I know,
he hasn't written a book on the Stamps, but he has an excellent web site
with very cogent technical analysis of Stamps in practical engineering
projects. Sorry Tracy. I've enjoyed several of your articles in the last
month.
Gary
"comp.arch.embedded".
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=5G6Ze_0uvuHApKPeXQxuFW6iTFBJE7Ti4RFD-mZRso3F4mIzNJyWc5A-NKpfM4Usz1Rwi7jRKiA]vimal222@y...[/url
Sent: Monday, October 20, 2003 10:39 PM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
Hi folks,
Is there a chip around for which i can call the code from command line
without having to go thro such details as we do for BS2?
pls suggest chips that have this functionality for i have come to see
that controller programming is possible only using the bundle that comes
with the chip. Is there any chip for which we dont need to press the
'go' button in the environment, and instead call the code from either
command line or from a C program ?
thanks
amul
Allan Lane <allan.lane@h...> wrote:
1. No, you cannot 'call' basic stamp code from your
'C' routines.
2. If you WANT to pass data from your PC to the
Basic Stamp, you'll have to use an RS-232 port for
communication. This you can do. You'll have to
program the BS2 to 'Listen' on the port, and the
PC to 'Talk' on the port. Having 'Talked', the PC
must now 'Listen' for the response from the Stamp.
Having 'Listened', and gotten something from the
PC, the Stamp must now process it in some way,
and give a response 'Talk' back to the PC with the
results.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> thanks for ur reply. I am still a bit confused though. so how
exactly would I call the basic stamp code from my C program?
>
> thanks, amul
>
> Jon Williams wrote:
> No, not unless you create your own program to call that then
> communicates with the Stamp via serial link. Remember, the BASIC
Stamp
> is an embedded processor so not all of our computer programming
> experiences are applicable. On the other hand, you can use your own
> editor and then pass your file to the BASIC Stamp compiler to be
> compiled and downloaded.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> Sent: Sunday, October 12, 2003 12:20 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] command line interface
>
>
> Hi group!
> i am new to basic stamp. Is there a way to call basic stamp code
from
> command line interface, or call basic stamp code from a C program
that
> uses "createprocess()" to call programs? please help.
>
> thanks,
> amul
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
<vimal222@y...> wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane <allan.lane@h...> wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for
> communication. This you can do. You'll have to
> program the BS2 to 'Listen' on the port, and the
> PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have changed it.
Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can better
understand my problem.We have a colony of robots moving around in a given space.
Through my C program, I can track the positions of the robots and compute the
coordinates and hence the distance moved, say every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and zeros, and
feeds them (we manually paste this) to the basic stamp (thats what we have now)
controller program, and then we manually run the basic stamp code, and the robot
moves. We then compute the distance moved, and feed that back to the scheme GA,
which generates another set of 1s and Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the scheme
GA would spit the ones and zeros to a text file. My C code can then read this
set of ones and zeros, and modify the controller code (handling this controller
code as text file). Now is the problem we have. How do we download this
controller code (a text file) into the controller so that the robot moves with
the new set of ones and zeros, that has been generated by the scheme code. If we
have a command(s) that can do it from within a C program that downloads this
file into the controller, it would be great!
I hope I have explained the problem clearly. Would the chip you mentioned be of
help to me in this case, with its bootloader code? Does the bootloader help in
this dynamic downloading? Thank you.
amul
Allan Lane <allan.lane@h...> wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for
> communication. This you can do. You'll have to
> program the BS2 to 'Listen' on the port, and the
> PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
we can work with. Parallax has a 'Tokenizer'
you can download which should let you do this.
http://www.parallax.com/html_pages/downloads/tokenizer/tokenizer.asp
(you may have to reassemble the above line in
notepad and then cut and paste to your browser)
They have a version for Windows, Mac, and Unix.
You feed your 'modified' PBasic source to the
Tokenizer, then implement the BS2 download
protocol to feed the resulting tokens
to the BS2 on-the-fly, from YOUR application.
"Self-Programming" implies having the BS2
modify itself, based on some criteria, which
is NOT what you are doing.
This approach has the PC modify the program it
loads into the BS2, and then load that program.
The BS2 is a recipient only. I'd call it
"on-the-fly downloading".
The good news is, since Parallax has made their
Tokenizer available, this should be doable with
the BS2 hardware.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
<vimal222@y...> wrote:
> that sounds promising!
> Yes, I basically want to be able to change the controller code thro
my C program, and download this code to the controller whenever I
have changed it.
> Is this on the fly downloading called "self programming"?
>
> Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around
in a given space. Through my C program, I can track the positions of
the robots and compute the coordinates and hence the distance moved,
say every 20 secs or so.
>
> Now, i have this person's scheme GA that generates a set of ones
and zeros, and feeds them (we manually paste this) to the basic stamp
(thats what we have now) controller program, and then we manually run
the basic stamp code, and the robot moves. We then compute the
distance moved, and feed that back to the scheme GA, which generates
another set of 1s and Zeros. We continue this process.
>
> what we want to do is automate all the manual steps. so this means,
the scheme GA would spit the ones and zeros to a text file. My C code
can then read this set of ones and zeros, and modify the controller
code (handling this controller code as text file). Now is the problem
we have. How do we download this controller code (a text file) into
the controller so that the robot moves with the new set of ones and
zeros, that has been generated by the scheme code. If we have a
command(s) that can do it from within a C program that downloads this
file into the controller, it would be great!
>
> I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code?
Does the bootloader help in this dynamic downloading? Thank you.
>
> amul
>
>
>
> Allan Lane <allan.lane@h...> wrote:
> It sounds like you want your PC-based program to
> be able to keep several 'Micro' programs on its
> hard disk, and then download the 'micro' program
> on the fly to whatever micro-processor destination
> will support this.
>
> This actually is do-able. MicroChip, the maker of
> the PIC chip in the Stamp, now has a version of
> their chip which can program itself. You want
> the 16F876 (28-pin Narrow DIP), or 16F877
> (40-pin wide DIP, more pins, otherwise identical).
>
> You'll want to go to a PIC site, and get some
> 'bootloader' code. You load the 'bootloader'
> code into the chip, then you can download your
> code to the chip on-the-fly. Start with
> www.phanderson.com, and follow links.
>
> IF I understand you correctly, that is.
>
> Yes, I basically want to be able to change the controller code
> thro my C program, and download this code to the controller
> whenever I have changed it.
> Is this on the fly downloading called "self programming"?
>
Well, not by me, but in any case this is a standard feature of the BS1. I
have assumed it is available on the BS2 as well. It is used primarily to
update customer hardware that includes a Basic Stamp without giving them
access to the editor or your source code.
You include BSAVE in your original code. That creates a token file on your
PC that is the "ones and zeros" for that program. You can do this for as
many programs as you like. On the Stamp, you write a small stub header in
each program that executes a load sequence at the appropriate time. That
sequence receives the token file from the other computer and loads it into
the Stamp memory.
Gary
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=1pPzsOuWLiEzMJ9zWrIEWpbEqJiqJvH0f9a0pjVw3vFGiR-c2hLBl82gcPfw8bJ8WUxgbG1ynO_rhipw]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane <allan.lane@h...> wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for
> communication. This you can do. You'll have to
> program the BS2 to 'Listen' on the port, and the
> PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
I haven't been following this thread very carefully, but based on what you
just said, why can't you just send the "string of ones and zeros" to the
Stamp via serial link, and have the program in the Stamp decide how to act
based on the string? This would seem a much easier and more conventional
approach than actually "rewiring" the Stamp code for each navigational
change. Using simple SERIN or SHIFTIN commands, you can receive the
"strings" and decide what to do (turn right, go ten feet, go back three
feet, etc.)
Or am I missing something?
- Robert
Original Message
From: "Vimal Vishwanathan" <vimal222@y...>
To: <basicstamps@yahoogroups.com>
Sent: Tuesday, October 21, 2003 10:58 AM
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
> that sounds promising!
> Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have changed
it.
> Is this on the fly downloading called "self programming"?
>
> Let me give a brief outline of the planned project so that you can better
understand my problem.We have a colony of robots moving around in a given
space. Through my C program, I can track the positions of the robots and
compute the coordinates and hence the distance moved, say every 20 secs or
so.
>
> Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
>
> what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can then
read this set of ones and zeros, and modify the controller code (handling
this controller code as text file). Now is the problem we have. How do we
download this controller code (a text file) into the controller so that the
robot moves with the new set of ones and zeros, that has been generated by
the scheme code. If we have a command(s) that can do it from within a C
program that downloads this file into the controller, it would be great!
>
> I hope I have explained the problem clearly. Would the chip you mentioned
be of help to me in this case, with its bootloader code? Does the bootloader
help in this dynamic downloading? Thank you.
>
> amul
But the problem as I have described is that the scheme code generates this set
of ones and zeros, and the C code takes this set of ones and zeros and changes
the basic stamp code and we download this new basic stamp code from the C
program itself. As Allan Lane suggested, it is called 'on the fly downloading'
and he suggested that I look at tokenizers offered by parallax. so i cannot do
it the conventional way bcos then we have to press the button to download the
new code. we want it automated.
amul
Robert Ussery <uavscience@f...> wrote:
Amul,
I haven't been following this thread very carefully, but based on what you
just said, why can't you just send the "string of ones and zeros" to the
Stamp via serial link, and have the program in the Stamp decide how to act
based on the string? This would seem a much easier and more conventional
approach than actually "rewiring" the Stamp code for each navigational
change. Using simple SERIN or SHIFTIN commands, you can receive the
"strings" and decide what to do (turn right, go ten feet, go back three
feet, etc.)
Or am I missing something?
- Robert
Original Message
From: "Vimal Vishwanathan"
To:
Sent: Tuesday, October 21, 2003 10:58 AM
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
> that sounds promising!
> Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have changed
it.
> Is this on the fly downloading called "self programming"?
>
> Let me give a brief outline of the planned project so that you can better
understand my problem.We have a colony of robots moving around in a given
space. Through my C program, I can track the positions of the robots and
compute the coordinates and hence the distance moved, say every 20 secs or
so.
>
> Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
>
> what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can then
read this set of ones and zeros, and modify the controller code (handling
this controller code as text file). Now is the problem we have. How do we
download this controller code (a text file) into the controller so that the
robot moves with the new set of ones and zeros, that has been generated by
the scheme code. If we have a command(s) that can do it from within a C
program that downloads this file into the controller, it would be great!
>
> I hope I have explained the problem clearly. Would the chip you mentioned
be of help to me in this case, with its bootloader code? Does the bootloader
help in this dynamic downloading? Thank you.
>
> amul
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
'on the fly downloading' as Allan called it. The scheme code generates the new
set of 'ones and zeros' on the fly. so we do not know this before hand to store
it.
Or am i wrong in interpreting your suggestion?
Jon Williams <jwilliams@p...> wrote:
How many discrete code changes do you need? Infinite? If you can live
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=zsKr7vauN4hQ65LGbv8-JrTaK0Sk-ChtIJ3G0A-BG17XPjZFBc9vey1id5ZMAUgT0CDorsjXtdIlL18]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for
> communication. This you can do. You'll have to
> program the BS2 to 'Listen' on the port, and the
> PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
or if the possibilities are infinite? If there is a known limit, you
can program them into the various program slots and call them with a
simple serial link that is managed by slot 0. You could even pass
parameters through the serial link to slot 0 which could then place them
into the Scratchpad to be used by the
So, no, this isn't on-the-fly reprogramming -- which is going to be
difficult, at best (and how are you going to do it without knowing what
you want?). I think that if you can define your behaviors and figure
out how many parameters you want to pass, you'll be able to get the
desired operation.
In my mind, your slot 0 program would look something like this:
' {$STAMP BS2e}
' {$PBASIC 2.5}
slot VAR Byte
params VAR Byte(8)
idx VAR Nib
Main:
SERIN 16, 84, [noparse][[/noparse]slot, STR params\8\"*"]
FOR idx = 0 TO 7
PUT idx, params(idx)
NEXT
RUN slot
END
The program accepts a slot number (1 - 7 = behavior desired) plus up to
eight bytes of parameters. If you want to send fewer than eight bytes,
send the parameters, then an asterisk. The target slot can pull the
parameters from the Scratchpad with GET. There's an article on our web
site in the Nuts & Volts articles section that details multi-bank
programming and will probably be useful.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=MaAxrsfzmUnHmkspU6GtTBlKEOFQTohxaHtq8j8LQMwTbAcARmq9CPTKTKuWUYnEkUgf6GqVqF1J5K7wKA]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:28 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
but dont we need the 7 programs before hand then? Or would this also
help with 'on the fly downloading' as Allan called it. The scheme code
generates the new set of 'ones and zeros' on the fly. so we do not know
this before hand to store it.
Or am i wrong in interpreting your suggestion?
Jon Williams <jwilliams@p...> wrote:
How many discrete code changes do you need? Infinite? If you can live
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=MaAxrsfzmUnHmkspU6GtTBlKEOFQTohxaHtq8j8LQMwTbAcARmq9CPTKTKuWUYnEkUgf6GqVqF1J5K7wKA]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for communication. This
> you can do. You'll have to program the BS2 to 'Listen' on the port,
> and the PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
time. The scheme GA generates the set of ones and zeros for every run of the GA.
We then feed this to the controller (the C program has to do this with the help
of the tokenizer library? ) and run it every time. so would the 'tokenizer
library' help in this process? I am kind of confused.I am going to look at this
option as suggested by Allan Lane.
Has anyone ever done this kind of on the fly downloading? pls suggest if so,
because I am stuck in this stage and this is only a part of the project. And
basic stamp programming is certainly not my strong point.
thanks, amul
Jon Williams <jwilliams@p...> wrote:
What I'm asking is that if you know a predetermined number of behaviors,
or if the possibilities are infinite? If there is a known limit, you
can program them into the various program slots and call them with a
simple serial link that is managed by slot 0. You could even pass
parameters through the serial link to slot 0 which could then place them
into the Scratchpad to be used by the
So, no, this isn't on-the-fly reprogramming -- which is going to be
difficult, at best (and how are you going to do it without knowing what
you want?). I think that if you can define your behaviors and figure
out how many parameters you want to pass, you'll be able to get the
desired operation.
In my mind, your slot 0 program would look something like this:
' {$STAMP BS2e}
' {$PBASIC 2.5}
slot VAR Byte
params VAR Byte(8)
idx VAR Nib
Main:
SERIN 16, 84, [noparse][[/noparse]slot, STR params\8\"*"]
FOR idx = 0 TO 7
PUT idx, params(idx)
NEXT
RUN slot
END
The program accepts a slot number (1 - 7 = behavior desired) plus up to
eight bytes of parameters. If you want to send fewer than eight bytes,
send the parameters, then an asterisk. The target slot can pull the
parameters from the Scratchpad with GET. There's an article on our web
site in the Nuts & Volts articles section that details multi-bank
programming and will probably be useful.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=l2LIXyQRLzfnf1YIMEW29oiQ6QxPUeJp83YNb13w3EgcThBc3UP7PbtV0LLzw4Oiv4ntcA0Agqms]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:28 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
but dont we need the 7 programs before hand then? Or would this also
help with 'on the fly downloading' as Allan called it. The scheme code
generates the new set of 'ones and zeros' on the fly. so we do not know
this before hand to store it.
Or am i wrong in interpreting your suggestion?
Jon Williams wrote:
How many discrete code changes do you need? Infinite? If you can live
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=l2LIXyQRLzfnf1YIMEW29oiQ6QxPUeJp83YNb13w3EgcThBc3UP7PbtV0LLzw4Oiv4ntcA0Agqms]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for communication. This
> you can do. You'll have to program the BS2 to 'Listen' on the port,
> and the PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
going to work for you. Why? Well, first you have to generate a PBASIC
source file, then you have to send it through the tokenizer module, then
you have to download it. Do you really think your C program can react
in a way that can write an appropriate PBASIC program to be compiled?
Keep in mind that the generation of PBASIC tokens is not documented
(Parallax intellectual property); this means you will have to generate
PBASIC source code which will end up coming from an internal "library"
of routines -- why not just put them in the Stamp to start with?
At the risk of sounding like a broken record ... I really think you
should evaluate the kinds of things you might want to do, categorize
them, then figure out what parameters you can pass to provide your
"infinite" variability. Your original post wanted to "call PBASIC
routines for C" -- well, sending parameters to a program that lives in
the Stamp accomplishes this, but only if you think about the
possibilities up front. In your parameters, you could pass a slot
number, then even a task number that lives within that slot (you can
call a task with ON task GOSUB TaskX, TaskY, TaskY, ...), the other
parameters in the list can be used by the task.
I would respectfully submit that if you're confused, you don't yet have
a handle on the end result.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=dgF1enT0tN01khas6Cs68LMgDryL4l-XRZQBMHJbdgRf_6xdvLdf0eEVwR5KJ5FC7_ySIFgjEAXTj0U]vimal222@y...[/url
Sent: Wednesday, October 22, 2003 8:03 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
Yeah, as u said the possibilities are infinite potentially, but its one
at a time. The scheme GA generates the set of ones and zeros for every
run of the GA. We then feed this to the controller (the C program has to
do this with the help of the tokenizer library? ) and run it every time.
so would the 'tokenizer library' help in this process? I am kind of
confused.I am going to look at this option as suggested by Allan Lane.
Has anyone ever done this kind of on the fly downloading? pls suggest if
so, because I am stuck in this stage and this is only a part of the
project. And basic stamp programming is certainly not my strong point.
thanks, amul
Jon Williams <jwilliams@p...> wrote:
What I'm asking is that if you know a predetermined number of behaviors,
or if the possibilities are infinite? If there is a known limit, you can
program them into the various program slots and call them with a simple
serial link that is managed by slot 0. You could even pass parameters
through the serial link to slot 0 which could then place them into the
Scratchpad to be used by the
So, no, this isn't on-the-fly reprogramming -- which is going to be
difficult, at best (and how are you going to do it without knowing what
you want?). I think that if you can define your behaviors and figure out
how many parameters you want to pass, you'll be able to get the desired
operation.
In my mind, your slot 0 program would look something like this:
' {$STAMP BS2e}
' {$PBASIC 2.5}
slot VAR Byte
params VAR Byte(8)
idx VAR Nib
Main:
SERIN 16, 84, [noparse][[/noparse]slot, STR params\8\"*"]
FOR idx = 0 TO 7
PUT idx, params(idx)
NEXT
RUN slot
END
The program accepts a slot number (1 - 7 = behavior desired) plus up to
eight bytes of parameters. If you want to send fewer than eight bytes,
send the parameters, then an asterisk. The target slot can pull the
parameters from the Scratchpad with GET. There's an article on our web
site in the Nuts & Volts articles section that details multi-bank
programming and will probably be useful.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=dgF1enT0tN01khas6Cs68LMgDryL4l-XRZQBMHJbdgRf_6xdvLdf0eEVwR5KJ5FC7_ySIFgjEAXTj0U]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:28 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
but dont we need the 7 programs before hand then? Or would this also
help with 'on the fly downloading' as Allan called it. The scheme code
generates the new set of 'ones and zeros' on the fly. so we do not know
this before hand to store it.
Or am i wrong in interpreting your suggestion?
Jon Williams wrote:
How many discrete code changes do you need? Infinite? If you can live
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=dgF1enT0tN01khas6Cs68LMgDryL4l-XRZQBMHJbdgRf_6xdvLdf0eEVwR5KJ5FC7_ySIFgjEAXTj0U]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for communication. This
> you can do. You'll have to program the BS2 to 'Listen' on the port,
> and the PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
>one at a time. The scheme GA generates the set of ones and zeros for
>every run of the GA. We then feed this to the controller (the C
>program has to do this with the help of the tokenizer library? ) and
>run it every time. so would the 'tokenizer library' help in this
>process?
Like others here, I think I'm confused about what you are trying to
accomplish. It sounds kind of like the "ones and zeros for every run
of the GA" is something like a sequence or a tape recording or a
scheme that the Stamp has to play back. For example, to be simple,
it might be a sequence of ones and zeros that have to be played back
with one second timing on pin P0 of the Stamp:
110000010001000.....
You could write each possible sequence of 1s and 0s as a separate
program and then reprogram the Stamp each time you need a new
sequence, and to do that from your C program you would need the
tokenizer.
Or, you could have one single Stamp program that "plays" the
sequence. It is possible to load new sequence data into a Stamp
_without_ invoking the tokenizer. The BASIC Stamp can be programmed
to accept commands from your C program, one of which would be to
accept the new sequence data, and another would be to "play" the
sequence.
What sort of sequence is "every run of the GA"?
-- Tracy
The sequence generated by the GA is just a set of ones and zeros that would
describe the direction that each leg of the robot(4 or 6 legs) moves by. so this
would look something like
100010101000
101010010100
It is possible to load new sequence data into a Stamp
_without_ invoking the tokenizer. The BASIC Stamp can be programmed
to accept commands from your C program, one of which would be to
accept the new sequence data, and another would be to "play" the
sequence.
The problem is we do not know this sequence in advance because the scheme code
generates it after every run. Every run is made only after the robot moves with
a particular set of ones and zeros, and then the distance moved is measured and
fed back into the scheme program. The scheme code does not generate the next set
UNTIL we feed this distance moved number. That is why we do not know the whole
set in advance. How would we load the new sequence every time without using
tokenizers?
i hope that clarifies my questions.
amul
Tracy Allen <tracy@e...> wrote:
>Yeah, as u said the possibilities are infinite potentially, but its
>one at a time. The scheme GA generates the set of ones and zeros for
>every run of the GA. We then feed this to the controller (the C
>program has to do this with the help of the tokenizer library? ) and
>run it every time. so would the 'tokenizer library' help in this
>process?
Like others here, I think I'm confused about what you are trying to
accomplish. It sounds kind of like the "ones and zeros for every run
of the GA" is something like a sequence or a tape recording or a
scheme that the Stamp has to play back. For example, to be simple,
it might be a sequence of ones and zeros that have to be played back
with one second timing on pin P0 of the Stamp:
110000010001000.....
You could write each possible sequence of 1s and 0s as a separate
program and then reprogram the Stamp each time you need a new
sequence, and to do that from your C program you would need the
tokenizer.
Or, you could have one single Stamp program that "plays" the
sequence. It is possible to load new sequence data into a Stamp
_without_ invoking the tokenizer. The BASIC Stamp can be programmed
to accept commands from your C program, one of which would be to
accept the new sequence data, and another would be to "play" the
sequence.
What sort of sequence is "every run of the GA"?
-- Tracy
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
issue.
Yes, I basically want to change the basic stamp code (but just those set of ones
and zeros that goes into the arrays,which tells which legs to move in what
direction) from the C program, and this is done one at a time. But done many
times.
would sending these ones and zeros as parameters to the stamp code work? If so,
do we send parameters using the method u described? I have not used stamp
program that much. But as i said, we know only 1 set of possibilities at a time.
Not the next one or the one after that etc.
my main issue is now we have to modify the stamp code manually and run it from
the IDE provided for it. But we would want to modify the program automatically
(just the set of ones and zeros that go into the arrays, nothing else)and
download it automatically and run it on the robot.
hope that clears it.
amul
Jon Williams <jwilliams@p...> wrote:
While it sounds very enticing, I don't think "on the fly" downloading is
going to work for you. Why? Well, first you have to generate a PBASIC
source file, then you have to send it through the tokenizer module, then
you have to download it. Do you really think your C program can react
in a way that can write an appropriate PBASIC program to be compiled?
Keep in mind that the generation of PBASIC tokens is not documented
(Parallax intellectual property); this means you will have to generate
PBASIC source code which will end up coming from an internal "library"
of routines -- why not just put them in the Stamp to start with?
At the risk of sounding like a broken record ... I really think you
should evaluate the kinds of things you might want to do, categorize
them, then figure out what parameters you can pass to provide your
"infinite" variability. Your original post wanted to "call PBASIC
routines for C" -- well, sending parameters to a program that lives in
the Stamp accomplishes this, but only if you think about the
possibilities up front. In your parameters, you could pass a slot
number, then even a task number that lives within that slot (you can
call a task with ON task GOSUB TaskX, TaskY, TaskY, ...), the other
parameters in the list can be used by the task.
I would respectfully submit that if you're confused, you don't yet have
a handle on the end result.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=U6kom85XuwIp0dAgmmD0fAkmLXn7f5qT_4r1jIffBTwGG7OLQ096bMJ7OffkT3fndNGifXkJmEoKOA]vimal222@y...[/url
Sent: Wednesday, October 22, 2003 8:03 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
Yeah, as u said the possibilities are infinite potentially, but its one
at a time. The scheme GA generates the set of ones and zeros for every
run of the GA. We then feed this to the controller (the C program has to
do this with the help of the tokenizer library? ) and run it every time.
so would the 'tokenizer library' help in this process? I am kind of
confused.I am going to look at this option as suggested by Allan Lane.
Has anyone ever done this kind of on the fly downloading? pls suggest if
so, because I am stuck in this stage and this is only a part of the
project. And basic stamp programming is certainly not my strong point.
thanks, amul
Jon Williams wrote:
What I'm asking is that if you know a predetermined number of behaviors,
or if the possibilities are infinite? If there is a known limit, you can
program them into the various program slots and call them with a simple
serial link that is managed by slot 0. You could even pass parameters
through the serial link to slot 0 which could then place them into the
Scratchpad to be used by the
So, no, this isn't on-the-fly reprogramming -- which is going to be
difficult, at best (and how are you going to do it without knowing what
you want?). I think that if you can define your behaviors and figure out
how many parameters you want to pass, you'll be able to get the desired
operation.
In my mind, your slot 0 program would look something like this:
' {$STAMP BS2e}
' {$PBASIC 2.5}
slot VAR Byte
params VAR Byte(8)
idx VAR Nib
Main:
SERIN 16, 84, [noparse][[/noparse]slot, STR params\8\"*"]
FOR idx = 0 TO 7
PUT idx, params(idx)
NEXT
RUN slot
END
The program accepts a slot number (1 - 7 = behavior desired) plus up to
eight bytes of parameters. If you want to send fewer than eight bytes,
send the parameters, then an asterisk. The target slot can pull the
parameters from the Scratchpad with GET. There's an article on our web
site in the Nuts & Volts articles section that details multi-bank
programming and will probably be useful.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=U6kom85XuwIp0dAgmmD0fAkmLXn7f5qT_4r1jIffBTwGG7OLQ096bMJ7OffkT3fndNGifXkJmEoKOA]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:28 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
but dont we need the 7 programs before hand then? Or would this also
help with 'on the fly downloading' as Allan called it. The scheme code
generates the new set of 'ones and zeros' on the fly. so we do not know
this before hand to store it.
Or am i wrong in interpreting your suggestion?
Jon Williams wrote:
How many discrete code changes do you need? Infinite? If you can live
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=U6kom85XuwIp0dAgmmD0fAkmLXn7f5qT_4r1jIffBTwGG7OLQ096bMJ7OffkT3fndNGifXkJmEoKOA]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for communication. This
> you can do. You'll have to program the BS2 to 'Listen' on the port,
> and the PC to 'Talk' on the port. Having 'Talked', the PC
> must now 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and Body of
the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
data. Suppose you have the sequences of 0s and 1s in a file that is
generated on your PC as a sequence of bytes, where bit 1 is for leg
1, bit 2 for leg 2 and so on, and bits 0 and 7 will always be zeros
(until you add two more legs!). Then the sequence your PC generates
will be,
00000110
00000000
00000010
00000000
00000110
00000000
00000100
00000010
00000101
00000000
11111111
and so on, for example. Maybe all 1s might mean, "End of sequence".
Anyway, the program in the Stamp would look something like this:
cmd var byte
chr var byte
ndx var word
initialize:
'whatever
Command_processor:
SERIN 16,$54,5000,[noparse][[/noparse]WAIT ("GA",cmd] wait for prefix "GA" + command from PC
LOOKDOWN cmd, [noparse][[/noparse]"RC"], ndx ' "R" for run, "C" for configure
BRANCH ndx, [noparse][[/noparse]Running, Configuring]
Running: ' play the sequence stored in eeprom
ndx=0 ' start at 0 in eeprom
DO
READ ndx,chr
IF chr=%11111111 THEN
' move the legs according to chr
ndx=ndx+1
LOOP
' do whatever at the end of sequence, repeat, stop, etc
STOP
Configuring: ' capture sequence codes from PC.
ndx=0 ' start at 0 in eeprom
DO
SERIN 16,$54,5000,error_receive,[noparse][[/noparse]chr]
WRITE ndx,chr
ndx=ndx+1
LOOP UNTIL chr=%11111111
' finished with upload
' a CRC might be a good idea
' return to command processor, or just RUN
' ???
GOTO Command_processor
Error_Receive:
' ring a bell or send a code back to PC
stop
The Stamp has to WRITE bytes to eeprom one at a time, which takes up
to 10 milliseconds per byte (usually 3 to 5), so the PC would have to
pace its transmission. Or you could implement a software or hardware
flow control scheme.
If you are using a Stamp 2p or 2pe, you have lots of eeprom available
for storage in the extra banks (16k in the BS2p, 32k in the BS2pe).
It is not so convenient to access the extra data banks in the BS2sx
or BS2e. If you have an original BS2, you have to be careful that
your data does not overwrite the program. In the Stamp, data is
stored from address 0 up in eeprom, while program is stored from
address 2047 down.
There is another approach to transferring data, which uses the native
programming algorithm of the Stamp. It would only be writing blocks
of data, not the program blocks. The advantage of this is that it is
very fast. It uses block level eeprom programming, and the protocol
includes a handshake for flow control. If you do that, your Stamp
program only has to play back the sequence, not to load it. However,
you would need to implement the programming protocol on your PC. It
is not hard. The protocol is described in the Parallax programmers
docs, and also here on my web site:
http://www.emesystems.com/BS2clone.htm
-- Tracy
>Hi Tracy,
>The sequence generated by the GA is just a set of ones and zeros
>that would describe the direction that each leg of the robot(4 or 6
>legs) moves by. so this would look something like
>
>100010101000
>101010010100
>
>It is possible to load new sequence data into a Stamp
>_without_ invoking the tokenizer. The BASIC Stamp can be programmed
>to accept commands from your C program, one of which would be to
>accept the new sequence data, and another would be to "play" the
>sequence.
>
>The problem is we do not know this sequence in advance because the
>scheme code generates it after every run. Every run is made only
>after the robot moves with a particular set of ones and zeros, and
>then the distance moved is measured and fed back into the scheme
>program. The scheme code does not generate the next set UNTIL we
>feed this distance moved number. That is why we do not know the
>whole set in advance. How would we load the new sequence every time
>without using tokenizers?
>
>i hope that clarifies my questions.
>
>amul
>
>
>
>
>
>Tracy Allen <tracy@e...> wrote:
>>Yeah, as u said the possibilities are infinite potentially, but its
>>one at a time. The scheme GA generates the set of ones and zeros for
>>every run of the GA. We then feed this to the controller (the C
>>program has to do this with the help of the tokenizer library? ) and
>>run it every time. so would the 'tokenizer library' help in this
>>process?
>
>Like others here, I think I'm confused about what you are trying to
>accomplish. It sounds kind of like the "ones and zeros for every run
>of the GA" is something like a sequence or a tape recording or a
>scheme that the Stamp has to play back. For example, to be simple,
>it might be a sequence of ones and zeros that have to be played back
>with one second timing on pin P0 of the Stamp:
>110000010001000.....
>
>You could write each possible sequence of 1s and 0s as a separate
>program and then reprogram the Stamp each time you need a new
>sequence, and to do that from your C program you would need the
>tokenizer.
>
>Or, you could have one single Stamp program that "plays" the
>sequence. It is possible to load new sequence data into a Stamp
>_without_ invoking the tokenizer. The BASIC Stamp can be programmed
>to accept commands from your C program, one of which would be to
>accept the new sequence data, and another would be to "play" the
>sequence.
>
>What sort of sequence is "every run of the GA"?
>
>-- Tracy
>
>
>
>To UNSUBSCRIBE, just send mail to:
>basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject
>and Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>Do you Yahoo!?
>The New Yahoo! Shopping - with improved product search
>
>[noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the
>Subject and Body of the message will be ignored.
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
what it seems like you want to do is generate table data to send to the
Stamp for processing -- by a program (or programs) that can live on the
Stamp (so you DON'T need to use a tokenizer/downloader).
Will you always need to send the same number of ones-and-zeros? If yes,
very easy. If no, not tough. If you arrays are more than eight or 10
bytes, you might want to store the data in the Scratchpad (and that way
you can still have separate programs that have access to it).
Main:
SERIN pin, baud, [noparse][[/noparse]slot, task, numParams]
PUT 0, task
FOR idx = 1 TO numParams
SERIN pin, baud, [noparse][[/noparse]aParam]
PUT idx, aParam
NEXT
RUN slot
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YFj7CoU9xo8dDx-jQHj72CTp-MYu2FyBFXVoISNVVwXXwm6TrGHThCSIbMBE4E4l5BOZAz6BRuQ]vimal222@y...[/url
Sent: Wednesday, October 22, 2003 9:10 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
Yeah, sorry for not being clear. I am kind of confused by the whole
basic stamp issue.
Yes, I basically want to change the basic stamp code (but just those set
of ones and zeros that goes into the arrays,which tells which legs to
move in what direction) from the C program, and this is done one at a
time. But done many times.
would sending these ones and zeros as parameters to the stamp code work?
If so, do we send parameters using the method u described? I have not
used stamp program that much. But as i said, we know only 1 set of
possibilities at a time. Not the next one or the one after that etc.
my main issue is now we have to modify the stamp code manually and run
it from the IDE provided for it. But we would want to modify the program
automatically (just the set of ones and zeros that go into the arrays,
nothing else)and download it automatically and run it on the robot.
hope that clears it.
amul
Jon Williams <jwilliams@p...> wrote:
While it sounds very enticing, I don't think "on the fly" downloading is
going to work for you. Why? Well, first you have to generate a PBASIC
source file, then you have to send it through the tokenizer module, then
you have to download it. Do you really think your C program can react in
a way that can write an appropriate PBASIC program to be compiled? Keep
in mind that the generation of PBASIC tokens is not documented (Parallax
intellectual property); this means you will have to generate PBASIC
source code which will end up coming from an internal "library" of
routines -- why not just put them in the Stamp to start with?
At the risk of sounding like a broken record ... I really think you
should evaluate the kinds of things you might want to do, categorize
them, then figure out what parameters you can pass to provide your
"infinite" variability. Your original post wanted to "call PBASIC
routines for C" -- well, sending parameters to a program that lives in
the Stamp accomplishes this, but only if you think about the
possibilities up front. In your parameters, you could pass a slot
number, then even a task number that lives within that slot (you can
call a task with ON task GOSUB TaskX, TaskY, TaskY, ...), the other
parameters in the list can be used by the task.
I would respectfully submit that if you're confused, you don't yet have
a handle on the end result.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YFj7CoU9xo8dDx-jQHj72CTp-MYu2FyBFXVoISNVVwXXwm6TrGHThCSIbMBE4E4l5BOZAz6BRuQ]vimal222@y...[/url
Sent: Wednesday, October 22, 2003 8:03 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
Yeah, as u said the possibilities are infinite potentially, but its one
at a time. The scheme GA generates the set of ones and zeros for every
run of the GA. We then feed this to the controller (the C program has to
do this with the help of the tokenizer library? ) and run it every time.
so would the 'tokenizer library' help in this process? I am kind of
confused.I am going to look at this option as suggested by Allan Lane.
Has anyone ever done this kind of on the fly downloading? pls suggest if
so, because I am stuck in this stage and this is only a part of the
project. And basic stamp programming is certainly not my strong point.
thanks, amul
Jon Williams wrote:
What I'm asking is that if you know a predetermined number of behaviors,
or if the possibilities are infinite? If there is a known limit, you can
program them into the various program slots and call them with a simple
serial link that is managed by slot 0. You could even pass parameters
through the serial link to slot 0 which could then place them into the
Scratchpad to be used by the
So, no, this isn't on-the-fly reprogramming -- which is going to be
difficult, at best (and how are you going to do it without knowing what
you want?). I think that if you can define your behaviors and figure out
how many parameters you want to pass, you'll be able to get the desired
operation.
In my mind, your slot 0 program would look something like this:
' {$STAMP BS2e}
' {$PBASIC 2.5}
slot VAR Byte
params VAR Byte(8)
idx VAR Nib
Main:
SERIN 16, 84, [noparse][[/noparse]slot, STR params\8\"*"]
FOR idx = 0 TO 7
PUT idx, params(idx)
NEXT
RUN slot
END
The program accepts a slot number (1 - 7 = behavior desired) plus up to
eight bytes of parameters. If you want to send fewer than eight bytes,
send the parameters, then an asterisk. The target slot can pull the
parameters from the Scratchpad with GET. There's an article on our web
site in the Nuts & Volts articles section that details multi-bank
programming and will probably be useful.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YFj7CoU9xo8dDx-jQHj72CTp-MYu2FyBFXVoISNVVwXXwm6TrGHThCSIbMBE4E4l5BOZAz6BRuQ]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:28 PM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
but dont we need the 7 programs before hand then? Or would this also
help with 'on the fly downloading' as Allan called it. The scheme code
generates the new set of 'ones and zeros' on the fly. so we do not know
this before hand to store it.
Or am i wrong in interpreting your suggestion?
Jon Williams wrote:
How many discrete code changes do you need? Infinite? If you can live
with seven, the easiest thing to do is use one of the multi-bank Stamps
(BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that waits
for your pc command and then uses RUN to select one of the other [noparse][[/noparse]seven]
program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0 to
get it back to the task router.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: Vimal Vishwanathan [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=YFj7CoU9xo8dDx-jQHj72CTp-MYu2FyBFXVoISNVVwXXwm6TrGHThCSIbMBE4E4l5BOZAz6BRuQ]vimal222@y...[/url
Sent: Tuesday, October 21, 2003 11:58 AM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
that sounds promising!
Yes, I basically want to be able to change the controller code thro my C
program, and download this code to the controller whenever I have
changed it. Is this on the fly downloading called "self programming"?
Let me give a brief outline of the planned project so that you can
better understand my problem.We have a colony of robots moving around in
a given space. Through my C program, I can track the positions of the
robots and compute the coordinates and hence the distance moved, say
every 20 secs or so.
Now, i have this person's scheme GA that generates a set of ones and
zeros, and feeds them (we manually paste this) to the basic stamp (thats
what we have now) controller program, and then we manually run the basic
stamp code, and the robot moves. We then compute the distance moved, and
feed that back to the scheme GA, which generates another set of 1s and
Zeros. We continue this process.
what we want to do is automate all the manual steps. so this means, the
scheme GA would spit the ones and zeros to a text file. My C code can
then read this set of ones and zeros, and modify the controller code
(handling this controller code as text file). Now is the problem we
have. How do we download this controller code (a text file) into the
controller so that the robot moves with the new set of ones and zeros,
that has been generated by the scheme code. If we have a command(s) that
can do it from within a C program that downloads this file into the
controller, it would be great!
I hope I have explained the problem clearly. Would the chip you
mentioned be of help to me in this case, with its bootloader code? Does
the bootloader help in this dynamic downloading? Thank you.
amul
Allan Lane wrote:
It sounds like you want your PC-based program to
be able to keep several 'Micro' programs on its
hard disk, and then download the 'micro' program
on the fly to whatever micro-processor destination
will support this.
This actually is do-able. MicroChip, the maker of
the PIC chip in the Stamp, now has a version of
their chip which can program itself. You want
the 16F876 (28-pin Narrow DIP), or 16F877
(40-pin wide DIP, more pins, otherwise identical).
You'll want to go to a PIC site, and get some
'bootloader' code. You load the 'bootloader'
code into the chip, then you can download your
code to the chip on-the-fly. Start with
www.phanderson.com, and follow links.
IF I understand you correctly, that is.
Note that this approach is more difficult than the
Stamp. Also note that once you've programmed
the Stamp, it KEEPS its program forever (or
until you re-program it) --
with or without power. It only RUNS the program
with power, of course. It just occurred to me
that this might be a misunderstanding you have.
Thus you can PROGRAM the stamp using the GUI,
then put the stamp anywhere else and RUN it
WITHOUT the GUI. As long as you supply +9
to +12 and a ground wire, the Stamp will run.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
wrote:
> Hi folks,
> Is there a chip around for which i can call the code from command
line without having to go thro such details as we do for BS2?
>
> pls suggest chips that have this functionality for i have come to
see that controller programming is possible only using the bundle
that comes with the chip. Is there any chip for which we dont need to
press the 'go' button in the environment, and instead call the code
from either command line or from a C program ?
>
> thanks
> amul
>
> Allan Lane wrote:
> 1. No, you cannot 'call' basic stamp code from your
> 'C' routines.
>
> 2. If you WANT to pass data from your PC to the
> Basic Stamp, you'll have to use an RS-232 port for communication. This
> you can do. You'll have to program the BS2 to 'Listen' on the port,
> and the PC to 'Talk' on the port. Having 'Talked', the PC must now
> 'Listen' for the response from the Stamp.
>
> Having 'Listened', and gotten something from the
> PC, the Stamp must now process it in some way,
> and give a response 'Talk' back to the PC with the
> results.
>
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > thanks for ur reply. I am still a bit confused though. so how
> exactly would I call the basic stamp code from my C program?
> >
> > thanks, amul
> >
> > Jon Williams wrote:
> > No, not unless you create your own program to call that then
> > communicates with the Stamp via serial link. Remember, the BASIC
> Stamp
> > is an embedded processor so not all of our computer programming
> > experiences are applicable. On the other hand, you can use your
own
> > editor and then pass your file to the BASIC Stamp compiler to be
> > compiled and downloaded.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > Sent: Sunday, October 12, 2003 12:20 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] command line interface
> >
> >
> > Hi group!
> > i am new to basic stamp. Is there a way to call basic stamp code
> from
> > command line interface, or call basic stamp code from a C program
> that
> > uses "createprocess()" to call programs? please help.
> >
> > thanks,
> > amul
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
Subject
> > and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
[noparse][[/noparse]Non-text portions of this message have been removed]
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
'C' program send out the serial port
to an already existing PBasic program
a set of behavior selecting parameters.
This looks like:
1. Decide what 'primitive' behaviors your
robots need to have.
2. Design a way of selecting these behaviors
with ones and zeros, output by your 'GA' program.
3. Write a PBasic program, which will receive
a set of these ones and zeros and store them in
BS2 eeprom. The BS2 should then read them from
eeprom and execute the chosen set of behaviors.
4. Write a program on the PC in 'C', which will
accept the sets of ones and zeros from the 'GA',
and send them to the PBasic program on the BS2.
And you're done.
Note the 'Tokenizer' approach may let you
implement more complex behaviors. You could
write a simpler 'Part3' above as a template.
However, 'Part4' becomes more complex, as your
'C' code now has to create a PBasic source
program on-the-fly which contains the behaviors you
want. You then use the tokenizer to convert
the source into BS2 tokens, and download those.
This could be MUCH more complicated than the
first approach.
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> While it sounds very enticing, I don't think "on the fly"
downloading is
> going to work for you. Why? Well, first you have to generate a
PBASIC
> source file, then you have to send it through the tokenizer module,
then
> you have to download it. Do you really think your C program can
react
> in a way that can write an appropriate PBASIC program to be
compiled?
> Keep in mind that the generation of PBASIC tokens is not documented
> (Parallax intellectual property); this means you will have to
generate
> PBASIC source code which will end up coming from an
internal "library"
> of routines -- why not just put them in the Stamp to start with?
>
> At the risk of sounding like a broken record ... I really think you
> should evaluate the kinds of things you might want to do, categorize
> them, then figure out what parameters you can pass to provide your
> "infinite" variability. Your original post wanted to "call PBASIC
> routines for C" -- well, sending parameters to a program that lives
in
> the Stamp accomplishes this, but only if you think about the
> possibilities up front. In your parameters, you could pass a slot
> number, then even a task number that lives within that slot (you can
> call a task with ON task GOSUB TaskX, TaskY, TaskY, ...), the other
> parameters in the list can be used by the task.
>
> I would respectfully submit that if you're confused, you don't yet
have
> a handle on the end result.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
>
Original Message
> From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> Sent: Wednesday, October 22, 2003 8:03 PM
> To: basicstamps@yahoogroups.com
> Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
>
>
> Yeah, as u said the possibilities are infinite potentially, but its
one
> at a time. The scheme GA generates the set of ones and zeros for
every
> run of the GA. We then feed this to the controller (the C program
has to
> do this with the help of the tokenizer library? ) and run it every
time.
> so would the 'tokenizer library' help in this process? I am kind of
> confused.I am going to look at this option as suggested by Allan
Lane.
> Has anyone ever done this kind of on the fly downloading? pls
suggest if
> so, because I am stuck in this stage and this is only a part of the
> project. And basic stamp programming is certainly not my strong
point.
>
> thanks, amul
>
> Jon Williams <jwilliams@p...> wrote:
> What I'm asking is that if you know a predetermined number of
behaviors,
> or if the possibilities are infinite? If there is a known limit,
you can
> program them into the various program slots and call them with a
simple
> serial link that is managed by slot 0. You could even pass
parameters
> through the serial link to slot 0 which could then place them into
the
> Scratchpad to be used by the
>
> So, no, this isn't on-the-fly reprogramming -- which is going to be
> difficult, at best (and how are you going to do it without knowing
what
> you want?). I think that if you can define your behaviors and
figure out
> how many parameters you want to pass, you'll be able to get the
desired
> operation.
>
> In my mind, your slot 0 program would look something like this:
>
> ' {$STAMP BS2e}
> ' {$PBASIC 2.5}
>
> slot VAR Byte
> params VAR Byte(8)
> idx VAR Nib
>
> Main:
> SERIN 16, 84, [noparse][[/noparse]slot, STR params\8\"*"]
> FOR idx = 0 TO 7
> PUT idx, params(idx)
> NEXT
> RUN slot
>
> END
>
> The program accepts a slot number (1 - 7 = behavior desired) plus
up to
> eight bytes of parameters. If you want to send fewer than eight
bytes,
> send the parameters, then an asterisk. The target slot can pull the
> parameters from the Scratchpad with GET. There's an article on our
web
> site in the Nuts & Volts articles section that details multi-bank
> programming and will probably be useful.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
>
>
Original Message
> From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> Sent: Tuesday, October 21, 2003 11:28 PM
> To: basicstamps@yahoogroups.com
> Subject: RE: [noparse][[/noparse]basicstamps] Re: command line interface
>
>
> but dont we need the 7 programs before hand then? Or would this also
> help with 'on the fly downloading' as Allan called it. The scheme
code
> generates the new set of 'ones and zeros' on the fly. so we do not
know
> this before hand to store it.
> Or am i wrong in interpreting your suggestion?
>
> Jon Williams wrote:
> How many discrete code changes do you need? Infinite? If you can
live
> with seven, the easiest thing to do is use one of the multi-bank
Stamps
> (BS2e, BS2sx, BS2p, BS2pe). In slot zero you put a "router" that
waits
> for your pc command and then uses RUN to select one of the other
[noparse][[/noparse]seven]
> program banks. When the task [noparse][[/noparse]bank] is completed it will use RUN 0
to
> get it back to the task router.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> Sent: Tuesday, October 21, 2003 11:58 AM
> To: basicstamps@yahoogroups.com
> Subject: Re: [noparse][[/noparse]basicstamps] Re: command line interface
>
>
> that sounds promising!
> Yes, I basically want to be able to change the controller code thro
my C
> program, and download this code to the controller whenever I have
> changed it. Is this on the fly downloading called "self
programming"?
>
> Let me give a brief outline of the planned project so that you can
> better understand my problem.We have a colony of robots moving
around in
> a given space. Through my C program, I can track the positions of
the
> robots and compute the coordinates and hence the distance moved, say
> every 20 secs or so.
>
> Now, i have this person's scheme GA that generates a set of ones and
> zeros, and feeds them (we manually paste this) to the basic stamp
(thats
> what we have now) controller program, and then we manually run the
basic
> stamp code, and the robot moves. We then compute the distance
moved, and
> feed that back to the scheme GA, which generates another set of 1s
and
> Zeros. We continue this process.
>
> what we want to do is automate all the manual steps. so this means,
the
> scheme GA would spit the ones and zeros to a text file. My C code
can
> then read this set of ones and zeros, and modify the controller code
> (handling this controller code as text file). Now is the problem we
> have. How do we download this controller code (a text file) into the
> controller so that the robot moves with the new set of ones and
zeros,
> that has been generated by the scheme code. If we have a command(s)
that
> can do it from within a C program that downloads this file into the
> controller, it would be great!
>
> I hope I have explained the problem clearly. Would the chip you
> mentioned be of help to me in this case, with its bootloader code?
Does
> the bootloader help in this dynamic downloading? Thank you.
>
> amul
>
>
>
> Allan Lane wrote:
> It sounds like you want your PC-based program to
> be able to keep several 'Micro' programs on its
> hard disk, and then download the 'micro' program
> on the fly to whatever micro-processor destination
> will support this.
>
> This actually is do-able. MicroChip, the maker of
> the PIC chip in the Stamp, now has a version of
> their chip which can program itself. You want
> the 16F876 (28-pin Narrow DIP), or 16F877
> (40-pin wide DIP, more pins, otherwise identical).
>
> You'll want to go to a PIC site, and get some
> 'bootloader' code. You load the 'bootloader'
> code into the chip, then you can download your
> code to the chip on-the-fly. Start with
> www.phanderson.com, and follow links.
>
> IF I understand you correctly, that is.
>
> Note that this approach is more difficult than the
> Stamp. Also note that once you've programmed
> the Stamp, it KEEPS its program forever (or
> until you re-program it) --
> with or without power. It only RUNS the program
> with power, of course. It just occurred to me
> that this might be a misunderstanding you have.
>
> Thus you can PROGRAM the stamp using the GUI,
> then put the stamp anywhere else and RUN it
> WITHOUT the GUI. As long as you supply +9
> to +12 and a ground wire, the Stamp will run.
>
> --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> wrote:
> > Hi folks,
> > Is there a chip around for which i can call the code from command
> line without having to go thro such details as we do for BS2?
> >
> > pls suggest chips that have this functionality for i have come to
> see that controller programming is possible only using the bundle
> that comes with the chip. Is there any chip for which we dont need
to
> press the 'go' button in the environment, and instead call the code
> from either command line or from a C program ?
> >
> > thanks
> > amul
> >
> > Allan Lane wrote:
> > 1. No, you cannot 'call' basic stamp code from your
> > 'C' routines.
> >
> > 2. If you WANT to pass data from your PC to the
> > Basic Stamp, you'll have to use an RS-232 port for communication.
This
>
> > you can do. You'll have to program the BS2 to 'Listen' on the
port,
> > and the PC to 'Talk' on the port. Having 'Talked', the PC
> > must now 'Listen' for the response from the Stamp.
> >
> > Having 'Listened', and gotten something from the
> > PC, the Stamp must now process it in some way,
> > and give a response 'Talk' back to the PC with the
> > results.
> >
> >
> > --- In basicstamps@yahoogroups.com, Vimal Vishwanathan
> > wrote:
> > > thanks for ur reply. I am still a bit confused though. so how
> > exactly would I call the basic stamp code from my C program?
> > >
> > > thanks, amul
> > >
> > > Jon Williams wrote:
> > > No, not unless you create your own program to call that then
> > > communicates with the Stamp via serial link. Remember, the BASIC
> > Stamp
> > > is an embedded processor so not all of our computer programming
> > > experiences are applicable. On the other hand, you can use your
> own
> > > editor and then pass your file to the BASIC Stamp compiler to
be
> > > compiled and downloaded.
> > >
> > > -- Jon Williams
> > > -- Applications Engineer, Parallax
> > > -- Dallas Office
> > >
> > >
> > >
Original Message
> > > From: Vimal Vishwanathan [noparse][[/noparse]mailto:vimal222@y...]
> > > Sent: Sunday, October 12, 2003 12:20 AM
> > > To: basicstamps@yahoogroups.com
> > > Subject: [noparse][[/noparse]basicstamps] command line interface
> > >
> > >
> > > Hi group!
> > > i am new to basic stamp. Is there a way to call basic stamp code
> > from
> > > command line interface, or call basic stamp code from a C
program
> > that
> > > uses "createprocess()" to call programs? please help.
> > >
> > > thanks,
> > > amul
> > >
> > >
> > >
> > > Do you Yahoo!?
> > > The New Yahoo! Shopping - with improved product search
> > >
> > > [noparse][[/noparse]Non-text portions of this message have been removed]
> > >
> > >
> > > To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > > from the same email address that you subscribed. Text in the
> Subject
> > > and Body of the message will be ignored.
> > >
> > >
> > > Your use of Yahoo! Groups is subject to
> > > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > > This message has been scanned by WebShield. Please report SPAM
to
> > > abuse@p...
> > >
> > >
> > > To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > > from the same email address that you subscribed. Text in the
> > Subject and Body of the message will be ignored.
> > >
> > >
> > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > > Do you Yahoo!?
> > > The New Yahoo! Shopping - with improved product search
> > >
> > > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and
> Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject
> and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
Your BS2 program must move the legs based on
data in EEPROM. There do exist ways of
reserving space in an EEPROM, writing data
to the reserved space, and reading data
from the reserved space.
Your BS2 program, which moves the legs, needs
to also 'listen' for a new data-set to be loaded
on its serial port.
The 'GA' generates the new data-set.
The 'C' program downloads the new data set over
the serial port to the 'listening' BS2 program.
The BS2 writes the new leg movement pattern
into on-chip eeprom. The 'C' program then
tells the BS2 to 'Go', and the BS2 then
executes the just loaded leg movement
pattern.
--- In basicstamps@yahoogroups.com, Vimal Vishwanathan
<vimal222@y...> wrote:
> Hi Tracy,
> The sequence generated by the GA is just a set of ones and zeros
that would describe the direction that each leg of the robot(4 or 6
legs) moves by. so this would look something like
>
> 100010101000
> 101010010100
>
> It is possible to load new sequence data into a Stamp
> _without_ invoking the tokenizer. The BASIC Stamp can be programmed
> to accept commands from your C program, one of which would be to
> accept the new sequence data, and another would be to "play" the
> sequence.
>
> The problem is we do not know this sequence in advance because the
scheme code generates it after every run. Every run is made only
after the robot moves with a particular set of ones and zeros, and
then the distance moved is measured and fed back into the scheme
program. The scheme code does not generate the next set UNTIL we feed
this distance moved number. That is why we do not know the whole set
in advance. How would we load the new sequence every time without
using tokenizers?
>
> i hope that clarifies my questions.
>
> amul
>
>
>
>
>
> Tracy Allen <tracy@e...> wrote:
> >Yeah, as u said the possibilities are infinite potentially, but
its
> >one at a time. The scheme GA generates the set of ones and zeros
for
> >every run of the GA. We then feed this to the controller (the C
> >program has to do this with the help of the tokenizer library? )
and
> >run it every time. so would the 'tokenizer library' help in this
> >process?
>
> Like others here, I think I'm confused about what you are trying to
> accomplish. It sounds kind of like the "ones and zeros for every
run
> of the GA" is something like a sequence or a tape recording or a
> scheme that the Stamp has to play back. For example, to be simple,
> it might be a sequence of ones and zeros that have to be played
back
> with one second timing on pin P0 of the Stamp:
> 110000010001000.....
>
> You could write each possible sequence of 1s and 0s as a separate
> program and then reprogram the Stamp each time you need a new
> sequence, and to do that from your C program you would need the
> tokenizer.
>
> Or, you could have one single Stamp program that "plays" the
> sequence. It is possible to load new sequence data into a Stamp
> _without_ invoking the tokenizer. The BASIC Stamp can be programmed
> to accept commands from your C program, one of which would be to
> accept the new sequence data, and another would be to "play" the
> sequence.
>
> What sort of sequence is "every run of the GA"?
>
> -- Tracy
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>
>
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
>
> [noparse][[/noparse]Non-text portions of this message have been removed]