Shop OBEX P1 Docs P2 Docs Learn Events
Upgrade from BS2 to BS2p 24 — Parallax Forums

Upgrade from BS2 to BS2p 24

G McMurryG McMurry Posts: 134
edited 2009-07-10 20:24 in BASIC Stamp
I have several great projects that I have been using the BS2 on for many years. I am currently doing one that is starting to eat up my processing time.

I happened to come across several BS2p 24 chips. How difficult is going to be for me to upgrade some of my projects to this device? I use the Basic Stamp Editor 2.4.2 and I often experiment with the NX-1000 Samp Works Board.Can I just plug the BS2p 24 into the Stamp Works Board and try some things? Is the BS2P 24 downward compatible with my BS2 commands?

THANKS IN ADVANCE FOR ANY ADVICE




For those interested, here is a little about my current project.

My latest project is a control panel for my 7.5" model train. This is a 1.5 inch scale train that you can actually ride. Many trains like mine are Live Steam. Some are battery only (like a golf cart) and some are gas over hydraulic. Mine is gas over electric.

I am currently using two BS2 stamp modules. One to operate my control panel that is connected via serial link to one that is mounted on the engine itself. Currently all operations such as the Ignition, Starter, Throttle, Choke, various power relays and Air Brakes (an interesting project in themselves) are controlled by BS2.

The next phase of my project is to monitor some of the engine activity and display operating voltage, current (amps), engine rpm, scale mph and anything else I can think of on three switchable rows of 3 digit 7-segment displays.

Some of the sub modules I am using in this project...

74hc165 input expander
74hc595 output expander
MAX232 rs232 Serial Interface
LM3914 Bar/Graph LED interface
MAX7219 8 digit 7-segment display driver
ADC0834 Analog to Digital Converter
PULSOUT commands to drive hobby servos (throttle and choke)
PWM to Analog with RC integrator as in Experiment #22 (create an analog voltage to drive air brake system)

I use Express PCB for all my printed circuit boards

Greg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
AUTOMATE EVERYTHING
http://www.trainyard.net

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-09 15:00
    Really, the only thing you have to be careful about are various timing constants (not PAUSE, but things like PULSOUT, SERIN, FREQOUT, etc.) These constants vary from Stamp model to Stamp model and they're thoroughly described in the Basic Stamp Syntax and Reference Manual in the chapters on each of the statements. If you need to have your programs work on a variety of Stamp models, the Manual shows how to use conditional compilation to provide different sets of named constants, one for each group of Stamp models.
  • G McMurryG McMurry Posts: 134
    edited 2009-07-09 15:09
    That's great news and a concise and thoughtful answer!

    THANKS

    Greg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    AUTOMATE EVERYTHING
    http://www.trainyard.net
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-07-09 16:24
    G McMurry said...
    I have several great projects that I have been using the BS2 on for many years. I am currently doing one that is starting to eat up my processing time.

    I happened to come across several BS2p 24 chips. How difficult is going to be for me to upgrade some of my projects to this device? I use the Basic Stamp Editor 2.4.2 and I often experiment with the NX-1000 Samp Works Board.Can I just plug the BS2p 24 into the Stamp Works Board and try some things? Is the BS2P 24 downward compatible with my BS2 commands?
    You'll find that the 2p (and 2px, and 2pe) have all of the commands that the BS2 has, plus a few additional ones. Take a look at the Stamp Editor's help file, and click on "Categorical Listing of Commands". You'll see some commands that are designed to make it easier to use I2C, Onewire, and parallel LCDs, as well as some other additional ones concerning use of I/O pins and what might be called "pseudointerrupts".
  • G McMurryG McMurry Posts: 134
    edited 2009-07-09 16:53
    I would love to be able to have some sort of interrupt ability. When I used the z-80 for my hobby stuff, I used the NMI (non maskable interrupt) all the time.

    Thanks.

    Greg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    AUTOMATE EVERYTHING
    http://www.trainyard.net
  • phil kennyphil kenny Posts: 233
    edited 2009-07-09 17:05
    Attached is a template for automatically selecting the baud rate for
    different model Stamps. Thanks to Jon Williams for this file.

    phil
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-09 17:29
    G McMurry,
    It's really not an interrupt in the sense you're thinking of. There's no way to return to the point where the interrupt occurred.

    As your projects get more complex, you should consider the Propeller with its speed, memory, and 8 independent processors.
  • PrettybirdPrettybird Posts: 269
    edited 2009-07-10 09:25
    Parallax can help you. I also have a parallax B2px and may want to upgrade in the future. I don't have the money to buy new things evertime something comes out but have see a few prop boards cheap on ebay. Having a hard enough time with BS2 programming now. Check old forum files. I found some of the same imfoo you are asking now. This year.
  • dev/nulldev/null Posts: 381
    edited 2009-07-10 11:19
    I looked at the "fake" interrupting style with POLLWAIT. It is very simple, and can't be used for any advanced programming. It could be used for simple applications, but it will mess up your code logic. In addition, it's not really an interrupt at all, because it doesn't interrupt anything. It's just a conditional addressing statement: If-this-PIN-is-high GOTO-somewhere, or set another PIN high.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • MSDTechMSDTech Posts: 342
    edited 2009-07-10 20:24
    G McMurry,
    If you want a true interrupt, you might want to look at the SX chips and the SX/B compiler (both available from parallax). With SX/B, the learning curve isn't as steep since it was designed to be a bridge from PBasic to assembler. I've been busy rebuilding my robot and have used the SX as an auxilliary processor. By the way, the heart of the BS2px is an SX processor that is running the PBasic Interpretor.
Sign In or Register to comment.