473,395 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

Nov 16 '05 #1
4 5625
Hai Ly Hoang wrote:
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

Nov 16 '05 #2
Hai Ly Hoang wrote:
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
--
----------------------------------------
Michel Leunen
mailto:mi****@leunen.com
http://www.leunen.com/cbuilder/
----------------------------------------

Nov 16 '05 #3
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" <an**@r2g2.nospamplease.co.uk> escribió en el mensaje
news:up********************************@4ax.com...
Hai Ly Hoang wrote:
I'm working on a project that make use of LPT (printer port) to connect toAT89C51 chip.
Under DOS, i use inport, outport() function of turbo c++ to write byte to3F8 port (printer port). How can i do such thing in windows (or exactly, howi write a program that can control the printer port directly ?)
Thanks in advance


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

Nov 16 '05 #4
"Jordi Maycas" <jm*****@hotmail.com> wrote in message
news:O3**************@TK2MSFTNGP12.phx.gbl...
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
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of...
2
by: Ruben Lysens | last post by:
Hi, Consider the example below. A Device controls a number of Ports. I'd like the Device to be in charge of creating/deleting Ports. I enforce this by making the Ports constructor and destructor...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
0
by: Jim dunn | last post by:
HI I am having problems with C# with regards to its compatibility with win32 API methods, I am trying to read from a windows CE comm port using C# and imported methods from coredll.dll, it seems...
11
by: Michael Tallhamer | last post by:
I am a medical physicist new to the .Net Framework and am trying to write a simple app that will monitor the output from a serial port on one of my linear accelerators using the new Serialport...
0
by: Vidyasagara Guntaka | last post by:
Hi, I'm not able to compile libpq for Windows environment using the 8.0.0 beta 1 source tree. I got the following errors (The entire compilation output is listed below): ...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
3
by: bharathreddy | last post by:
This article will explain you how to find the status of the fax operation. (Using FAXCOM.dll). Author: Bharath Reddy VasiReddy Reference to the FAXCOM.DLL Reference to import FAXCOM...
1
by: ssndk123 | last post by:
Hi, Using the UserPort program that changes permissions in XP so that I am able to write directly to the parallel port using assembler.. I'm trying to send out square wave pulses for x number...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.