Shop OBEX P1 Docs P2 Docs Learn Events
Urgent BS1 help needed from newbie — Parallax Forums

Urgent BS1 help needed from newbie

ArchiverArchiver Posts: 46,084
edited 2004-04-23 14:04 in General Discussion
Hi! I've just joined the group, and urgently need some help, if at all
possible.

Brief background: I've been doing embedded control programming for 25+
years, but this is the first time I've ever used the Basic Stamp. I
consider myself fairly knowledgeable in microcontrollers, assembly
language, etc., and have designed/built many device programmers over the
years as well. This is by way of being able to 'gauge' my background
for any reply -- in other words, I'm a complete novice on the Basic
Stamp, but am very knowledgeable on embedded programming in general.

I have a client who had a device built about 9 years ago using the BS1.
The 'source' code is available (hopefully it is accurate, there are no
comments or documentation for it), but it was a project that was
'shelved' because it never worked quite right, and the original engineer
is long gone. The unit 'sort of' worked, in the sense that I believe
the BS1 was doing what it was being told to do, but there are several
flaws that I've found in the code that are partially responsible for the
problems (the other problems having to do with hardware issues with the
device the BS1 is talking to).

I have reviewed/understand the code (reasonably well), and have looked
at the Basic Stamp design sufficiently to see how it is put together. I
needed to download/change the code, so I downloaded the 2.1 beta program
for doing the programming. This appears to be the only current version
of code that will work with the BS1 unit. By the way, I am using WinXP
Pro for my development station.

It appears that the only current way to program the BS1 is through a
serial port adapter. Even though the needed adapter is only $5, I can't
afford the time (this is an emergency for my client), and so I built one
by hand using parts from Radio Shack (and, of course, the Radio Shack
transistors didn't match the pin-out on the package, but I digress).
Although the adapter did not work at first, once I got the right
orientation for the transistors, the ver. 2.1 beta program was able to
'see' the BS1 on my COM port.

The problem came about when I tried to 'run' the program. The BS1 unit
would be found, it would indicate that it was sending the data to the
device, and then right at the end of transferring the data, it would
have an "access violation at 00403304 in Stampw_v2.1_Beta_1.exe" and
would not continue. The BS1 at this point no longer appears to run any
program (the original program has been 're-loaded', in theory, but it's
not working). I tried to enable debug to see what is going on, but
because I get the error message each time, there is obviously some
problem (I assume with the beta program).

So, here are my questions (in no particular order):

1. Has anyone experienced this particular error? Anyone know what
causes it, or how to avoid it?
2. Is there another windows version of software that will work for the BS1?
3. If not, must one use the DOS version of programming software to
program the BS1?
4. If one must use a previous version of programming software, does one
need to revert to a parallel port programming cable? If so, is it just
a matter of a couple of wires to a connector, or is additional circuitry
needed (as with the serial converter)?
5. If one must use the DOS version, how much of a 'DOS' environment is
necessary? Could a 'boot from floppy' version of Win98 or Win95 DOS
work, or must it be something like DOS 6?
6. Any additional pointers that anyone can give? My goal is to simply
make the 'relatively' minor modifications necessary and reload the
program. It would be gravy to get something like the DEBUG command to work.

Thanks in advance to any/all who respond, any help is appreciated.

David Erbas-White

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-22 14:15
    The BS1 'DOS' program is very simple -- so booting
    from a DOS floppy should work. The big problem with
    using Win NT, Win 2000, or WIN XP is that these
    'big-boy' operating systems treat any 'inp' or 'outp'
    direct port instruction as PRIVELEGED -- and you get
    a privelege violation when a legacy DOS program tries
    to directly toggle the parallel port.

    There do exist 'system driver' programs which
    re-enable the inp and outp functionality for
    'normal' programs -- but you would be opening a
    security hole in your XP installation.

    Booting into DOS should get around this OS limitation.
    I believe the parallel port cable is VERY simple --
    just a few wires.

    The other problem is: Do you really HAVE a parallel
    port? Recently, PC's are starting to be built which
    only have USB.


    --- In basicstamps@yahoogroups.com, David Erbas-White <derbas@a...>
    wrote:
    > Hi! I've just joined the group, and urgently need some help, if at
    all
    > possible.
    >
    > Brief background: I've been doing embedded control programming for
    25+
    > years, but this is the first time I've ever used the Basic Stamp.
    I
    > consider myself fairly knowledgeable in microcontrollers, assembly
    > language, etc., and have designed/built many device programmers
    over the
    > years as well. This is by way of being able to 'gauge' my
    background
    > for any reply -- in other words, I'm a complete novice on the Basic
    > Stamp, but am very knowledgeable on embedded programming in general.
    >
    > I have a client who had a device built about 9 years ago using the
    BS1.
    > The 'source' code is available (hopefully it is accurate, there are
    no
    > comments or documentation for it), but it was a project that was
    > 'shelved' because it never worked quite right, and the original
    engineer
    > is long gone. The unit 'sort of' worked, in the sense that I
    believe
    > the BS1 was doing what it was being told to do, but there are
    several
    > flaws that I've found in the code that are partially responsible
    for the
    > problems (the other problems having to do with hardware issues with
    the
    > device the BS1 is talking to).
    >
    > I have reviewed/understand the code (reasonably well), and have
    looked
    > at the Basic Stamp design sufficiently to see how it is put
    together. I
    > needed to download/change the code, so I downloaded the 2.1 beta
    program
    > for doing the programming. This appears to be the only current
    version
    > of code that will work with the BS1 unit. By the way, I am using
    WinXP
    > Pro for my development station.
    >
    > It appears that the only current way to program the BS1 is through
    a
    > serial port adapter. Even though the needed adapter is only $5, I
    can't
    > afford the time (this is an emergency for my client), and so I
    built one
    > by hand using parts from Radio Shack (and, of course, the Radio
    Shack
    > transistors didn't match the pin-out on the package, but I
    digress).
    > Although the adapter did not work at first, once I got the right
    > orientation for the transistors, the ver. 2.1 beta program was able
    to
    > 'see' the BS1 on my COM port.
    >
    > The problem came about when I tried to 'run' the program. The BS1
    unit
    > would be found, it would indicate that it was sending the data to
    the
    > device, and then right at the end of transferring the data, it
    would
    > have an "access violation at 00403304 in Stampw_v2.1_Beta_1.exe"
    and
    > would not continue. The BS1 at this point no longer appears to run
    any
    > program (the original program has been 're-loaded', in theory, but
    it's
    > not working). I tried to enable debug to see what is going on, but
    > because I get the error message each time, there is obviously some
    > problem (I assume with the beta program).
    >
    > So, here are my questions (in no particular order):
    >
    > 1. Has anyone experienced this particular error? Anyone know what
    > causes it, or how to avoid it?
    > 2. Is there another windows version of software that will work for
    the BS1?
    > 3. If not, must one use the DOS version of programming software to
    > program the BS1?
    > 4. If one must use a previous version of programming software, does
    one
    > need to revert to a parallel port programming cable? If so, is it
    just
    > a matter of a couple of wires to a connector, or is additional
    circuitry
    > needed (as with the serial converter)?
    > 5. If one must use the DOS version, how much of a 'DOS' environment
    is
    > necessary? Could a 'boot from floppy' version of Win98 or Win95
    DOS
    > work, or must it be something like DOS 6?
    > 6. Any additional pointers that anyone can give? My goal is to
    simply
    > make the 'relatively' minor modifications necessary and reload the
    > program. It would be gravy to get something like the DEBUG command
    to work.
    >
    > Thanks in advance to any/all who respond, any help is appreciated.
    >
    > David Erbas-White
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-22 15:56
    Q: When the program sees the BS1, what version does it report? It
    should be 1.4 -- if the connector is incorrectly installed it will
    report version 0.0 (obviously not correct).

    I also use WinXP Pro and have had NO problems with the editor using the
    BS1. But my machine has a lot of resources (1 gig of RAM) and that may
    be helping me. Try shutting down any other application that could be
    stealing resources from your machine and see if this improves the
    situation.

    Or .. you could punt back to the DOS software, but you'll need to boot
    to DOS or use a DOS machine. Of course, the DOS software uses the
    parallel port for programming.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: David Erbas-White [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=f90bM7rBH_WFyC2JruiONOKDYBvhMbIOhK4i_mejSnpVqmeE6Wkd-OfT3ARf6JJ0hyhVwFqLprdRYMJiIA]derbas@a...[/url
    Sent: Thursday, April 22, 2004 3:11 AM
    To: Basic Stamps
    Subject: [noparse][[/noparse]basicstamps] Urgent BS1 help needed from newbie


    Hi! I've just joined the group, and urgently need some help, if at all
    possible.

    Brief background: I've been doing embedded control programming for 25+
    years, but this is the first time I've ever used the Basic Stamp. I
    consider myself fairly knowledgeable in microcontrollers, assembly
    language, etc., and have designed/built many device programmers over the

    years as well. This is by way of being able to 'gauge' my background
    for any reply -- in other words, I'm a complete novice on the Basic
    Stamp, but am very knowledgeable on embedded programming in general.

    I have a client who had a device built about 9 years ago using the BS1.

    The 'source' code is available (hopefully it is accurate, there are no
    comments or documentation for it), but it was a project that was
    'shelved' because it never worked quite right, and the original engineer

    is long gone. The unit 'sort of' worked, in the sense that I believe
    the BS1 was doing what it was being told to do, but there are several
    flaws that I've found in the code that are partially responsible for the

    problems (the other problems having to do with hardware issues with the
    device the BS1 is talking to).

    I have reviewed/understand the code (reasonably well), and have looked
    at the Basic Stamp design sufficiently to see how it is put together. I

    needed to download/change the code, so I downloaded the 2.1 beta program

    for doing the programming. This appears to be the only current version
    of code that will work with the BS1 unit. By the way, I am using WinXP
    Pro for my development station.

    It appears that the only current way to program the BS1 is through a
    serial port adapter. Even though the needed adapter is only $5, I can't

    afford the time (this is an emergency for my client), and so I built one

    by hand using parts from Radio Shack (and, of course, the Radio Shack
    transistors didn't match the pin-out on the package, but I digress).
    Although the adapter did not work at first, once I got the right
    orientation for the transistors, the ver. 2.1 beta program was able to
    'see' the BS1 on my COM port.

    The problem came about when I tried to 'run' the program. The BS1 unit
    would be found, it would indicate that it was sending the data to the
    device, and then right at the end of transferring the data, it would
    have an "access violation at 00403304 in Stampw_v2.1_Beta_1.exe" and
    would not continue. The BS1 at this point no longer appears to run any
    program (the original program has been 're-loaded', in theory, but it's
    not working). I tried to enable debug to see what is going on, but
    because I get the error message each time, there is obviously some
    problem (I assume with the beta program).

    So, here are my questions (in no particular order):

    1. Has anyone experienced this particular error? Anyone know what
    causes it, or how to avoid it?
    2. Is there another windows version of software that will work for the
    BS1? 3. If not, must one use the DOS version of programming software to
    program the BS1?
    4. If one must use a previous version of programming software, does one
    need to revert to a parallel port programming cable? If so, is it just
    a matter of a couple of wires to a connector, or is additional circuitry

    needed (as with the serial converter)?
    5. If one must use the DOS version, how much of a 'DOS' environment is
    necessary? Could a 'boot from floppy' version of Win98 or Win95 DOS
    work, or must it be something like DOS 6?
    6. Any additional pointers that anyone can give? My goal is to simply
    make the 'relatively' minor modifications necessary and reload the
    program. It would be gravy to get something like the DEBUG command to
    work.

    Thanks in advance to any/all who respond, any help is appreciated.

    David Erbas-White
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-22 18:00
    David-

    I would highly recommend working in DOS off the parallel port.
    Fewer things to go wrong. Works fine from a Windows 95 DOS
    environment. A simple text file, cables.txt, describes what you
    need. It's also shown in the newer manuals etc. The relevant
    portion follows:

    BASIC Stamp I (PC parallel port):

    Parallel Stamp D Pin Stamp D BS1-IC Pin BS1-IC Notes
    25 1 GND 2 GND/Vss <<< on Stamp
    11 2 BUSY 3 PCO
    2 3 DATA 4 PCI


    Last I looked, the DOS editor is still available for download from
    Parallax.

    Regards,

    Steve
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-22 23:32
    David Erbas-White wrote:


    Thanks to all who replied.

    I ended up trying a different WinXP system (a relatively 'new'
    installation), and the 2.1 Beta program appeared to work okay, except
    that I got the same error as on the other machine at two different
    (random) times. It's not repeatable on this machine, and it appears to
    be working well enough to get me through. For future use, I'll make a
    parallel port cable (yes, I do have a real parallel port), and will try
    the DOS stuff at some point (but I'd really like to find out what is
    happening to cause the error in the Windows beta version).

    As a side note, it turns out that what purported to be the original code
    in the BS1 was (not possibly) correct, since it reflected different pin
    numbers doing different types of toggling, but at least it gave me a
    'feel' for what the intent was. I'm in the process of attempting to
    solidfy the code now, adding the necessary error checking needed for
    'real' operation (the original design, for example, would give incorrect
    outputs when the outside device was not connected).

    This type of group feedback is very helpful, and is greatly
    appreciated. I don't know how much I'll be using the Basic Stamp after
    this project, but I'll certainly try and contribute if I keep using it.

    David Erbas-White
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-23 14:04
    Dangere Will Robinson!!!

    I have been doing other DOS work to parallel ports. Windows 2000 does not
    give you timely access to a parallel port. 95 does well (I have run my
    software from a DOS window in 95), and I think 98 (I don't remember, but
    think so). But 2000, the commands do NOT go through directly. There is a
    variable length of time delay, before sending the commands out the parallel
    port. It appears that the commands are collected for a while, and then go
    through as a burst of commands. Not good.

    Original Message
    From: S Parkis [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=JvMoefDistuj78KnCv-Xo74tKaeLrb7Tqhdm7iS8sn9yz19XPAEJ3vkJPJBCpLWt6hNUlYudn_RNYv74QA]parkiss@e...[/url
    Sent: Thursday, April 22, 2004 1:01 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Urgent BS1 help needed from newbie


    David-

    I would highly recommend working in DOS off the parallel port.
    Fewer things to go wrong. Works fine from a Windows 95 DOS
    environment. A simple text file, cables.txt, describes what you
    need. It's also shown in the newer manuals etc. The relevant
    portion follows:
Sign In or Register to comment.