Progamming Space BS2p
Archiver
Posts: 46,084
Guy & Gals,
Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
datalogger for a depth mic.
I am really happy with everything I've done, including using shift
registers to bring the data in from the mic, setting up a I2C
network to read the EEPROM and RTC and A/D converter.
The data logger has a menu driven GUI consisting of mostly text and
standard Seetron menu bars, but the unit and interface work well for
what I'm trying to do.
The system is used to measure depths and to calculate and print the
results. It takes baselines, and then final measurments and
subtracts the two to show the overall length change. It also
compares the lengh to user configurable limits and diplays whether
the measurement is within the criteria.
All that said... I've ran out of memory space. Feature creap has
gotten he best of me. I'm now finding that I can't seem to fit the
routine to read the RTC or the A/D for battery monitoring. I would
venture to say I need about 20% more space. But maybe more.
What can I do? I like to think my code is faily efficient, but it
may not be, I'm a Mechanical Engineer not a programmer.
I have sockets on the board I made up for EEPROMs on the I2C
network. Is there anyway I can use this space for more programing
space. Even 15 or 20 more lines would make a big difference right
now.
I've read a little about some sort of programming Banking but not
sure what it means or if it can help me. Please advise to anything
that you guys think I could do to squeeze more lines of code into my
datal ogger without switching to a different type of controller and
writing new code.
thanks in advance
Mike Dolan
Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
datalogger for a depth mic.
I am really happy with everything I've done, including using shift
registers to bring the data in from the mic, setting up a I2C
network to read the EEPROM and RTC and A/D converter.
The data logger has a menu driven GUI consisting of mostly text and
standard Seetron menu bars, but the unit and interface work well for
what I'm trying to do.
The system is used to measure depths and to calculate and print the
results. It takes baselines, and then final measurments and
subtracts the two to show the overall length change. It also
compares the lengh to user configurable limits and diplays whether
the measurement is within the criteria.
All that said... I've ran out of memory space. Feature creap has
gotten he best of me. I'm now finding that I can't seem to fit the
routine to read the RTC or the A/D for battery monitoring. I would
venture to say I need about 20% more space. But maybe more.
What can I do? I like to think my code is faily efficient, but it
may not be, I'm a Mechanical Engineer not a programmer.
I have sockets on the board I made up for EEPROMs on the I2C
network. Is there anyway I can use this space for more programing
space. Even 15 or 20 more lines would make a big difference right
now.
I've read a little about some sort of programming Banking but not
sure what it means or if it can help me. Please advise to anything
that you guys think I could do to squeeze more lines of code into my
datal ogger without switching to a different type of controller and
writing new code.
thanks in advance
Mike Dolan
Comments
If you are still in bank 0 then, you are in luck you have the
other banks to store the data or run program. The bank switching on the
Bs2ps is fair simple. The best start is to look at your code to see if
there is a installation section that only needs to be ran once. If so
then put that in bank 0. You would then put the main code in bank 1.
Switching banks is done with the 'run' command found in the help in the
stamp editor or in the Stamp manual version 2.0 on page 269. For the
directive this is found on page 37 of the stamp manual. If you need one
I can send you a simple example.
Stephen Swanson
Technical Support Manager
Parallax, Inc.
599 Menlo Drive, #100
Rocklin, CA 95765
Phone (916) 624-8333
E-mail ..... sswanson@p...
Main site...... www.parallax.com
Educational site.... www.parallax.com/sic
Javelin Stamp... www.parallax.com/javelin
Original Message
From: MikDolan54 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=uPgKaEQYEzpyYydp9RPMubm12eUhKwwnOSV4nHlA2XvAgu9V5XqLJGh8TGfIXFUrMQlRum3eHg]MikeD@B...[/url
Sent: Friday, April 16, 2004 4:44 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Progamming Space BS2p
Guy & Gals,
Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
datalogger for a depth mic.
I am really happy with everything I've done, including using shift
registers to bring the data in from the mic, setting up a I2C
network to read the EEPROM and RTC and A/D converter.
The data logger has a menu driven GUI consisting of mostly text and
standard Seetron menu bars, but the unit and interface work well for
what I'm trying to do.
The system is used to measure depths and to calculate and print the
results. It takes baselines, and then final measurments and
subtracts the two to show the overall length change. It also
compares the lengh to user configurable limits and diplays whether
the measurement is within the criteria.
All that said... I've ran out of memory space. Feature creap has
gotten he best of me. I'm now finding that I can't seem to fit the
routine to read the RTC or the A/D for battery monitoring. I would
venture to say I need about 20% more space. But maybe more.
What can I do? I like to think my code is faily efficient, but it
may not be, I'm a Mechanical Engineer not a programmer.
I have sockets on the board I made up for EEPROMs on the I2C
network. Is there anyway I can use this space for more programing
space. Even 15 or 20 more lines would make a big difference right
now.
I've read a little about some sort of programming Banking but not
sure what it means or if it can help me. Please advise to anything
that you guys think I could do to squeeze more lines of code into my
datal ogger without switching to a different type of controller and
writing new code.
thanks in advance
Mike Dolan
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.
Yahoo! Groups Links
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
MikeD@B... writes:
> I've read a little about some sort of programming Banking but not
> sure what it means or if it can help me. Please advise to anything
> that you guys think I could do to squeeze more lines of code into my
> datal ogger without switching to a different type of controller and
> writing new code.
>
>
The BS2P has 8 banks of 2K bytes each. Do you know how to use them?
For a start, look up 'run' in the Editor Help file.
Sid Weaver
W4EKQ
Port Richey, FL
[noparse][[/noparse]Non-text portions of this message have been removed]
not using banks 1 - 7 for storage (it's all in external EE). If that's
the case, you have a lot of resources left, you'll just have to
re-organize a bit (which may not be a bad idea since you say you've
succumbed to feature creep).
Multi-bank programming is not horribly difficult, it just requires a bit
of thought. This article will explain my thoughts and practices using
multiple program banks.
http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv87.pdf
Dr. Tracy Allen has some great information on his web site as well:
http://www.emesystems.com/BS2SX.htm
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: MikDolan54 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=baUWSBs88le7yrd7eWtrT3jiDTefjxSJWyw582TdsOZwK6m9AfzweVqBTuUQJqkAEJaijIcGaH0P]MikeD@B...[/url
Sent: Friday, April 16, 2004 6:44 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Progamming Space BS2p
Guy & Gals,
Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
datalogger for a depth mic.
I am really happy with everything I've done, including using shift
registers to bring the data in from the mic, setting up a I2C
network to read the EEPROM and RTC and A/D converter.
The data logger has a menu driven GUI consisting of mostly text and
standard Seetron menu bars, but the unit and interface work well for
what I'm trying to do.
The system is used to measure depths and to calculate and print the
results. It takes baselines, and then final measurments and
subtracts the two to show the overall length change. It also
compares the lengh to user configurable limits and diplays whether
the measurement is within the criteria.
All that said... I've ran out of memory space. Feature creap has
gotten he best of me. I'm now finding that I can't seem to fit the
routine to read the RTC or the A/D for battery monitoring. I would
venture to say I need about 20% more space. But maybe more.
What can I do? I like to think my code is faily efficient, but it
may not be, I'm a Mechanical Engineer not a programmer.
I have sockets on the board I made up for EEPROMs on the I2C
network. Is there anyway I can use this space for more programing
space. Even 15 or 20 more lines would make a big difference right
now.
I've read a little about some sort of programming Banking but not
sure what it means or if it can help me. Please advise to anything
that you guys think I could do to squeeze more lines of code into my
datal ogger without switching to a different type of controller and
writing new code.
thanks in advance
Mike Dolan
As others have pointed out, RUN allows you to get at those other
banks for programming. More tips. (1) Put your strings in DATA, and
(2) use the STORE command.
You say this is a menu driven GUI, which probably means that you have
a lot of text.
A command like this eats a lot of eeprom space:
SEROUT 0,sbaud, [noparse][[/noparse]"This is a very deep lake"]
SEROUT 0,sbaud, [noparse][[/noparse]"I think I see the monster"]
Each byte in the string stored that way actually takes up 14 bits of
eeprom. In the following way each byte takes 8 bits, plus the
routine that does the actual printing. The break even point for the
space taken by the routine is very low.
lake DATA "This is a very deep lake",0 ' null terminated
ness DATA "I think I see the monster",0
idx=lake ' starting addrs of the data string
GOSUB showIt
idx=ness
GOSUB showIt
END
show_It:
DO
READ idx,char
if char=0 then RETURN
SEROUT 0,sbaud,[noparse][[/noparse]char]
idx=idx+1
LOOP
That will save you even more space if the data strings are stored in
another bank. That takes advantage of the BS2p STORE command. You
have to enter the addresses as constants in the bank that uses them,
if the RUN bank is different from the STORE bank.
lake CON 0
ness CON 25
Are you taking advantage of the STORE command?
>Guy & Gals,
>
>Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
>datalogger for a depth mic.
>
>I am really happy with everything I've done, including using shift
>registers to bring the data in from the mic, setting up a I2C
>network to read the EEPROM and RTC and A/D converter.
>
>The data logger has a menu driven GUI consisting of mostly text and
>standard Seetron menu bars, but the unit and interface work well for
>what I'm trying to do.
>
>The system is used to measure depths and to calculate and print the
>results. It takes baselines, and then final measurments and
>subtracts the two to show the overall length change. It also
>compares the lengh to user configurable limits and diplays whether
>the measurement is within the criteria.
>
>All that said... I've ran out of memory space. Feature creap has
>gotten he best of me. I'm now finding that I can't seem to fit the
>routine to read the RTC or the A/D for battery monitoring. I would
>venture to say I need about 20% more space. But maybe more.
>
>What can I do? I like to think my code is faily efficient, but it
>may not be, I'm a Mechanical Engineer not a programmer.
>
>I have sockets on the board I made up for EEPROMs on the I2C
>network. Is there anyway I can use this space for more programing
>space. Even 15 or 20 more lines would make a big difference right
>now.
>
>I've read a little about some sort of programming Banking but not
>sure what it means or if it can help me. Please advise to anything
>that you guys think I could do to squeeze more lines of code into my
>datal ogger without switching to a different type of controller and
>writing new code.
>
>thanks in advance
>Mike Dolan
Read Jon and Tracy's material. It is real good. I just restructered
my code based on their work.
My project has feature creeped so much that I am now am seeing the
end of bank 5. Leaving me just two more.
I have the BS2pe which has an additional 8 banks for storage.
Hopefully, someone will comment on the following idea.
Given appropriate code to move things around, programs can be stored,
but not executed, in those additional 8 banks can't they?
Take care,
Frank
--- In basicstamps@yahoogroups.com, "MikDolan54" <MikeD@B...> wrote:
> Guy & Gals,
>
> Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
> datalogger for a depth mic.
>
> I am really happy with everything I've done, including using shift
> registers to bring the data in from the mic, setting up a I2C
> network to read the EEPROM and RTC and A/D converter.
>
> The data logger has a menu driven GUI consisting of mostly text and
> standard Seetron menu bars, but the unit and interface work well
for
> what I'm trying to do.
>
> The system is used to measure depths and to calculate and print the
> results. It takes baselines, and then final measurments and
> subtracts the two to show the overall length change. It also
> compares the lengh to user configurable limits and diplays whether
> the measurement is within the criteria.
>
> All that said... I've ran out of memory space. Feature creap has
> gotten he best of me. I'm now finding that I can't seem to fit
the
> routine to read the RTC or the A/D for battery monitoring. I would
> venture to say I need about 20% more space. But maybe more.
>
> What can I do? I like to think my code is faily efficient, but
it
> may not be, I'm a Mechanical Engineer not a programmer.
>
> I have sockets on the board I made up for EEPROMs on the I2C
> network. Is there anyway I can use this space for more programing
> space. Even 15 or 20 more lines would make a big difference right
> now.
>
> I've read a little about some sort of programming Banking but not
> sure what it means or if it can help me. Please advise to
anything
> that you guys think I could do to squeeze more lines of code into
my
> datal ogger without switching to a different type of controller and
> writing new code.
>
> thanks in advance
> Mike Dolan
thanks for the reply,
No I have not used the STORE command at all.
I am aware that text strings are quite cumbersome so I eliminated
just about everthing I could, and made the most of the 15 available
stored screens in the 128x32 graphics LCD.
I think I have maybe 3 or 4 serouts where I'm writing things
like ".", or "," or "1" or "2". Thus very little red text. If I
used any of them several times, I stored the ASCII values as
constants on the primary EEPROM. They take up code space this way,
but only once? I think that helps, am I correct?
I'm delighted to hear that there is plenty of unused programing space
available on the BS2p. I really need it. Why is this not
documented in the manual anywhere? or where is it? Wouldn't it make
sense to have the editor account for this space with its memory
map? I feel kind of silly not realizing all this space was
available. But I'm mostly greatfull it's there.
I've written lots of PLC code before, and chose the BSPp thinking
that ~4000 instruction would be plenty to do what I am trying to
accomplish. I soon ran out of space, but never couted my
instructions. Now it seems everyone is telling me that more space
is available, but you have to know how to get to it. I guess it is
likely that my code is only using up approximately ~500 instructions.
How can I detemine this? just counting lines?
anyway thanks for you support,
Mike Dolan
--- In basicstamps@yahoogroups.com, Tracy Allen <tracy@e...> wrote:
> Hi Mike,
>
> As others have pointed out, RUN allows you to get at those other
> banks for programming. More tips. (1) Put your strings in DATA,
and
> (2) use the STORE command.
>
> You say this is a menu driven GUI, which probably means that you
have
> a lot of text.
>
> A command like this eats a lot of eeprom space:
>
> SEROUT 0,sbaud, [noparse][[/noparse]"This is a very deep lake"]
> SEROUT 0,sbaud, [noparse][[/noparse]"I think I see the monster"]
>
> Each byte in the string stored that way actually takes up 14 bits
of
> eeprom. In the following way each byte takes 8 bits, plus the
> routine that does the actual printing. The break even point for
the
> space taken by the routine is very low.
>
> lake DATA "This is a very deep lake",0 ' null terminated
> ness DATA "I think I see the monster",0
>
> idx=lake ' starting addrs of the data string
> GOSUB showIt
> idx=ness
> GOSUB showIt
> END
>
>
> show_It:
> DO
> READ idx,char
> if char=0 then RETURN
> SEROUT 0,sbaud,[noparse][[/noparse]char]
> idx=idx+1
> LOOP
>
> That will save you even more space if the data strings are stored
in
> another bank. That takes advantage of the BS2p STORE command. You
> have to enter the addresses as constants in the bank that uses
them,
> if the RUN bank is different from the STORE bank.
>
> lake CON 0
> ness CON 25
>
> Are you taking advantage of the STORE command?
>
>
>
>
> >Guy & Gals,
> >
> >Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
> >datalogger for a depth mic.
> >
> >I am really happy with everything I've done, including using shift
> >registers to bring the data in from the mic, setting up a I2C
> >network to read the EEPROM and RTC and A/D converter.
> >
> >The data logger has a menu driven GUI consisting of mostly text and
> >standard Seetron menu bars, but the unit and interface work well
for
> >what I'm trying to do.
> >
> >The system is used to measure depths and to calculate and print the
> >results. It takes baselines, and then final measurments and
> >subtracts the two to show the overall length change. It also
> >compares the lengh to user configurable limits and diplays whether
> >the measurement is within the criteria.
> >
> >All that said... I've ran out of memory space. Feature creap has
> >gotten he best of me. I'm now finding that I can't seem to fit
the
> >routine to read the RTC or the A/D for battery monitoring. I would
> >venture to say I need about 20% more space. But maybe more.
> >
> >What can I do? I like to think my code is faily efficient, but
it
> >may not be, I'm a Mechanical Engineer not a programmer.
> >
> >I have sockets on the board I made up for EEPROMs on the I2C
> >network. Is there anyway I can use this space for more programing
> >space. Even 15 or 20 more lines would make a big difference right
> >now.
> >
> >I've read a little about some sort of programming Banking but not
> >sure what it means or if it can help me. Please advise to
anything
> >that you guys think I could do to squeeze more lines of code into
my
> >datal ogger without switching to a different type of controller and
> >writing new code.
> >
> >thanks in advance
> >Mike Dolan
thanks for the reply,
No I have not used the STORE command at all.
I am aware that text strings are quite cumbersome so I eliminated
just about everthing I could, and made the most of the 15 available
stored screens in the 128x32 graphics LCD.
I think I have maybe 3 or 4 serouts where I'm writing things
like ".", or "," or "1" or "2". Thus very little red text. If I
used any of them several times, I stored the ASCII values as
constants on the primary EEPROM. They take up code space this way,
but only once? I think that helps, am I correct?
I'm delighted to hear that there is plenty of unused programing space
available on the BS2p. I really need it. Why is this not
documented in the manual anywhere? or where is it? Wouldn't it make
sense to have the editor account for this space with its memory
map? I feel kind of silly not realizing all this space was
available. But I'm mostly greatfull it's there.
I've written lots of PLC code before, and chose the BSPp thinking
that ~4000 instruction would be plenty to do what I am trying to
accomplish. I soon ran out of space, but never couted my
instructions. Now it seems everyone is telling me that more space
is available, but you have to know how to get to it. I guess it is
likely that my code is only using up approximately ~500 instructions.
How can I detemine this? just counting lines?
anyway thanks for you support,
Mike Dolan
--- In basicstamps@yahoogroups.com, Tracy Allen <tracy@e...> wrote:
> Hi Mike,
>
> As others have pointed out, RUN allows you to get at those other
> banks for programming. More tips. (1) Put your strings in DATA,
and
> (2) use the STORE command.
>
> You say this is a menu driven GUI, which probably means that you
have
> a lot of text.
>
> A command like this eats a lot of eeprom space:
>
> SEROUT 0,sbaud, [noparse][[/noparse]"This is a very deep lake"]
> SEROUT 0,sbaud, [noparse][[/noparse]"I think I see the monster"]
>
> Each byte in the string stored that way actually takes up 14 bits
of
> eeprom. In the following way each byte takes 8 bits, plus the
> routine that does the actual printing. The break even point for
the
> space taken by the routine is very low.
>
> lake DATA "This is a very deep lake",0 ' null terminated
> ness DATA "I think I see the monster",0
>
> idx=lake ' starting addrs of the data string
> GOSUB showIt
> idx=ness
> GOSUB showIt
> END
>
>
> show_It:
> DO
> READ idx,char
> if char=0 then RETURN
> SEROUT 0,sbaud,[noparse][[/noparse]char]
> idx=idx+1
> LOOP
>
> That will save you even more space if the data strings are stored
in
> another bank. That takes advantage of the BS2p STORE command. You
> have to enter the addresses as constants in the bank that uses
them,
> if the RUN bank is different from the STORE bank.
>
> lake CON 0
> ness CON 25
>
> Are you taking advantage of the STORE command?
>
>
>
>
> >Guy & Gals,
> >
> >Using the BS2p40 and a Seeton 128x32 graphics LCD I've developed a
> >datalogger for a depth mic.
> >
> >I am really happy with everything I've done, including using shift
> >registers to bring the data in from the mic, setting up a I2C
> >network to read the EEPROM and RTC and A/D converter.
> >
> >The data logger has a menu driven GUI consisting of mostly text and
> >standard Seetron menu bars, but the unit and interface work well
for
> >what I'm trying to do.
> >
> >The system is used to measure depths and to calculate and print the
> >results. It takes baselines, and then final measurments and
> >subtracts the two to show the overall length change. It also
> >compares the lengh to user configurable limits and diplays whether
> >the measurement is within the criteria.
> >
> >All that said... I've ran out of memory space. Feature creap has
> >gotten he best of me. I'm now finding that I can't seem to fit
the
> >routine to read the RTC or the A/D for battery monitoring. I would
> >venture to say I need about 20% more space. But maybe more.
> >
> >What can I do? I like to think my code is faily efficient, but
it
> >may not be, I'm a Mechanical Engineer not a programmer.
> >
> >I have sockets on the board I made up for EEPROMs on the I2C
> >network. Is there anyway I can use this space for more programing
> >space. Even 15 or 20 more lines would make a big difference right
> >now.
> >
> >I've read a little about some sort of programming Banking but not
> >sure what it means or if it can help me. Please advise to
anything
> >that you guys think I could do to squeeze more lines of code into
my
> >datal ogger without switching to a different type of controller and
> >writing new code.
> >
> >thanks in advance
> >Mike Dolan