Connect with us

Parallel Port problem

Discussion in 'Electronic Design' started by Andy, Feb 14, 2006.

Scroll to continue with content
  1. Andy

    Andy Guest

    Andy writes:
    I read with interest the post a couple days ago about interfacing the

    Parallel Port with C, using a special driver.

    However, my problem is a little different. Perhaps some of the gurus
    here can give me a similarly easy solution.

    I like to write programs in GWBASIC. Yes, I know it is an obsolete
    language, but I have been using it for 40 years and have no need
    to do anything more "modern". And I have dozens of
    programs that I wrote in olden times, that I still like
    to use.

    If my computer boots into
    Windows98SE , and I load BASIC, the OUT X,y command to the
    printer port doesn't work. I have to boot in DOS from a floppy.
    Of find an "old" computer and use Windows 3.1 and shell to DOS.

    So, what are the OTHER ways that I can load GWBASIC and write
    a program that doesn't require loading special drivers and stuff if I
    use a computer that automatically boots into one of the later
    WINDOWS op systems....?

    Thanks for your advice. I am aware of my obsolescence, but I have
    retired, and see no desire to learn later languages (grin)...

    Andy in TExas
  2. Most likely, since Win98 is running in protected mode, it is blocking the
    ports to the virtual86(i.e. real mode) instance that GWBasic is running in.

    Several possible solutions are,

    Instal GWBasic onto a boot disk and update the autoexec.bat file to run it
    after boot up. You will probably need to get a hold of an older dos boot
    image(like dos 3 through dos 6). They can be found online with explinations
    on how to put them onto the floppy. If you use the Win98 boot disk method
    it may or may not work as, if I remember correctly, it does some stuff with
    the memory... basicaly to get more than 1 meg of memory it uses protected
    mode. By doing that it can take control of the ports(which seems to be the
    problem in this case). Although it can't hurt to try it as it might be a
    quick and easy solution.

    Find a newer version of Basic that runs in windows. This is probably the
    best solution as you'll get the benefit of running it in windows and
    probably some other things too(maybe debugging and multiple instances,
    etc...). (ofcourse there is no guarantee that the ports will work but I
    don't see any reason why they shouldn't... except that windows still can
    take control of the ports(for multi tasking and such) so you might have to
    figure out another way then simply using the OUT command(but it will
    probably work).


  3. Andy,

    W98SE like - W95 and WME - still have DOS underneath. If you press F8 on
    boottime, you'll get a menu in which you can choose "Command line only". I
    never tried out but I'm pretty sure your OUT X,Y will work when you start
    GWBASIC from that command line. Guess it's worth a try.

    Once Windows has started, you get a DOSbox when going to the command line.
    Windows fires up a virtual DOS machine which it keeps isolated from the
    hardware. Even if you "Restart in MSDOS mode", Windows keeps some influence
    in the background. DOS programs do not always act the same in both DOS

    DOS programs that start directly in Windows - generally .EXE programs - do
    not use a virtual DOS machine but run on the underlying DOS. In that case
    direct IO does not give problems. Of course you need to start them directly
    from Windows (double clicking the .EXE or using a shortcut) and not from the
    DOS box.

    petrus bitbyter
  4. Guest

    Or upgrade to "Liberty Basic", its a little clunkier then GW basic but
    it takes advantage of windows and supports the parallel port with "inp"
    and "Out" and supports a lot of windows functions.

    Steve Roberts

  5. steve,

    Never heard about it. Where can I find it?

    petrus bitbyter
  6. Guest

    -Carl Gundel, author of Liberty BASIC
  7. Do you have to use the parallel port or can you use serial port?

    -Le Chaud Lapin-
  8. Robert Baer

    Robert Baer Guest

    I use the last DOS-based BASIC (and compiler) that M$ made,
    "Professional Development System" ver 7.1 (or 7.2, do not remember).
    In Win98SE or Win2000, i shell to MSDOS (or COMMAND for Win2K) and
    QBX <progname>.BAS to run non-compiled programs, or just type in the
    prog name if compiled.
    I have never had any problems.
    Have the manual in scanned format if anyone needs that; with all of
    the PDS programs and support files it easily fits on a CD with room to
  9. Liberty Basic looks good from what I've seen with a quick websearch.

    Being a cheapskate, I've been using "yabasic" which is completely free,
    but has no development environment so you have to have to integrate it
    with one of the many free "programmer's editors" - which is actually
    the way I prefer it. It also has a compiler to convert the basic into
    a Windows executable, if you want.

    No "inp" and "out" so you have to treat the ports as files called
    "lpt1:", "com1:" etc.

    I like it because I can dash out a few lines of code to do some
    engineering calculation, and even pop up a graphics window if needed.

    This just for amusement:
  10. Well, from what I remember of QBASIC, the later BASIC that came with
    DOS 5, you could treat the parallel and serial ports as files instead.
    GWBASIC is probably the same.

    For example, to access the serial ports via the operating system,
    rather than via direct access to the hardware, I would set the baud
    rate to 115200 in the Windows config, then output from QBASIC to a file
    called "COM1:", and it worked fine.

    I guess the parallel port would be more problematic - you'd use "LPT1:"
    as the filename, but you'd need to have the Centronics handshake
    working on the port. So you'd feed the /STRB ouput back into the /ACK
    input, and put an 8-bit d-type latch onto the end of the cable, latched
    on the rising edge of /STRB.

    Then again, maybe it is time that you switched to Liberty Basic. ;)
  11. Si Ballenger

    Si Ballenger Guest

    I've got a page below with some simple parallel port stuff. There
    is usually no hardware access problems on win 95/98. On NT/2K/XP
    you may need the driver fix to get access. Qbasic comes on the
    win 95/98 CD and accesses the parallel port easily.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day