Using LPT port

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hai Ly Hoang

    #1

    Using LPT port

    I'm working on a project that make use of LPT (printer port) to connect to
    AT89C51 chip.
    Under DOS, i use inport, outport() function of turbo c++ to write byte to
    3F8 port (printer port). How can i do such thing in windows (or exactly, how
    i write a program that can control the printer port directly ?)
    Thanks in advance



  • Andy Sinclair

    #2
    Re: Using LPT port

    Hai Ly Hoang wrote:[color=blue]
    >I'm working on a project that make use of LPT (printer port) to connect to
    >AT89C51 chip.
    >Under DOS, i use inport, outport() function of turbo c++ to write byte to
    >3F8 port (printer port). How can i do such thing in windows (or exactly, how
    >i write a program that can control the printer port directly ?)
    >Thanks in advance[/color]

    http://www.lvr.com/parport.htm

    Comment

    • Michel Leunen

      #3
      Re: Using LPT port

      Hai Ly Hoang wrote:
      [color=blue]
      > Under DOS, i use inport, outport() function of turbo c++ to write byte to
      > 3F8 port (printer port). How can i do such thing in windows (or exactly, how
      > i write a program that can control the printer port directly ?)[/color]

      Under Windows, you need a device driver to access the IO ports. You can
      either create your own using teh Device Driver Kit from Microsoft (DDK)
      or use one of the generic device drivers available on the net. Do a
      search on DlPortIO with google, for instance.

      Michel
      --
      ----------------------------------------
      Michel Leunen
      mailto:michel@l eunen.com

      ----------------------------------------

      Comment

      • Jordi Maycas

        #4
        Re: Using LPT port

        or you can use asm in, and out instructions.

        asm in port,byte
        asm out port,byte

        You can use asm inside the c code (you must have the masm, or tasm
        compiler).


        "Andy Sinclair" <andy@r2g2.nosp amplease.co.uk> escribió en el mensaje
        news:upa7pv8b84 70mreefcf0621cb ovqoloavt@4ax.c om...[color=blue]
        > Hai Ly Hoang wrote:[color=green]
        > >I'm working on a project that make use of LPT (printer port) to connect[/color][/color]
        to[color=blue][color=green]
        > >AT89C51 chip.
        > >Under DOS, i use inport, outport() function of turbo c++ to write byte[/color][/color]
        to[color=blue][color=green]
        > >3F8 port (printer port). How can i do such thing in windows (or exactly,[/color][/color]
        how[color=blue][color=green]
        > >i write a program that can control the printer port directly ?)
        > >Thanks in advance[/color]
        >
        > http://www.lvr.com/parport.htm
        >[/color]


        Comment

        • Igor Tandetnik

          #5
          Re: Using LPT port

          "Jordi Maycas" <jmaycas@hotmai l.com> wrote in message
          news:O3PsW6gmDH A.2772@TK2MSFTN GP12.phx.gbl...[color=blue]
          > or you can use asm in, and out instructions.
          >
          > asm in port,byte
          > asm out port,byte[/color]

          Only works on Win9x, but not on the real OS (WinNT, 2K and so on).
          NT-bases OS prevents user-mode programs from directly accessing hardware
          ports.
          --
          With best wishes,
          Igor Tandetnik

          "For every complex problem, there is a solution that is simple, neat,
          and wrong." H.L. Mencken


          Comment

          Working...