Using LPT port

  • Thread starter Thread starter Hai Ly Hoang
  • Start date Start date
H

Hai Ly Hoang

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
 
Hai said:
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 ?)

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
--
 
Hai said:
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

http://www.lvr.com/parport.htm
 
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).
 
Jordi Maycas said:
or you can use asm in, and out instructions.

asm in port,byte
asm out port,byte

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
 
Back
Top