Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LPT output under windows

Status
Not open for further replies.

grv2k4

Newbie level 4
Joined
Dec 25, 2004
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
67
output data to lpt1

can anybody please explain the data patterns that is sent by the parallel port in (Turbo-C++ running under) Windows?


I created a custom LPT-connector by soldering the 16 wires(8 data bits, 8 Grounds) on to a 25 pin LPT male connector, and connected a number of LEDs on the other side of those wires. Then I created a C program to output data , using 0x3BC as the port address( i know this IS the correct port address) . However, the data displayed by the LEDs is random. If I issue 0xFF as the output, shouldn't ALL LEDs be lighted up? The result was however not that way.
I tried different combinations, (e.g. 0x00,0x04,0xf0 etc.), but the data patterns as shown by the LEDs does not seem to make any sense. Please Help!

--PeacE--
 

Ace-X

Advanced Member level 2
Joined
Jan 25, 2002
Messages
529
Helped
41
Reputation
82
Reaction score
14
Trophy points
1,298
Location
Germany
Activity points
5,150
c++ lpt output

Did you check that your LPT port is configured in SPP mode?
 

    V

    Points: 2
    Helpful Answer Positive Rating

e_eja

Full Member level 2
Joined
Nov 15, 2003
Messages
141
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,296
Activity points
1,079
c++ builder+lpt

hi grv2k4
I have same problem with you unless i connect the port parelell with PPI 8255 , It's seem that computer running to fast hence my PPI 8255 could capture the data from computer.
I have configured my 8255 as SPP, would anybody help me?
 

Debracom

Newbie level 5
Joined
Dec 27, 2004
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
119
parallel port monitor lpt1

some more information would be great.
If you use windowsXP (home or pro doesn't matter) or any other NT based windows it isn't so easy to talk to your LPT port. you will probably need a component. I don't know how it's done under turbo C++. for borland C++ builder or Visual C++ I can give u some help. I made some simple programs myself for builder, if u r interested I can always mail them.
I am not sure but I think there are some header files with different instructions available for turbo C++ (readbyte/writebyte if I remember correctly) which can talk to the LPT port if you work under a NT based windows though don't shoot me if I'm wrong.
 

Johnson

Advanced Member level 2
Joined
Oct 4, 2004
Messages
520
Helped
28
Reputation
56
Reaction score
7
Trophy points
1,298
Activity points
3,613
Search the forum for Parallel port programming! You can directly read or write data to/from LPT. Also go to microsoft.com, and search for it. You may find a sample program which tell you how to use MFC functions on LPT.
 

tgq

Full Member level 5
Joined
Jul 15, 2002
Messages
289
Helped
7
Reputation
14
Reaction score
4
Trophy points
1,298
Activity points
2,360
i've experienced old fashionned languages under new windoze OS and result is sometimes surprising when triying to access normally forbidden hardware 8)
for example old 16 bits quickbasic can access LPT with OUT function under Windoze NT (usually NT gives a marvellous privileged instruction wraning and refuses to access to LPT) !!!
 

Ace-X

Advanced Member level 2
Joined
Jan 25, 2002
Messages
529
Helped
41
Reputation
82
Reaction score
14
Trophy points
1,298
Location
Germany
Activity points
5,150
Better get any parallel port monitor and try to set data bits one by one.
 

kekon

Full Member level 3
Joined
Sep 19, 2002
Messages
156
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,298
Location
Poland, Białystok
Activity points
1,493
I wonder why microsoft made it so extremely difficult to control such simple device as LPT port ! To control it in a "legal way" under windows (from Delphi, C-Builder, Visual C etc.) one needs to find special drivers even if it's only setting single D0..D7 pins to desired state.
 

kekon

Full Member level 3
Joined
Sep 19, 2002
Messages
156
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,298
Location
Poland, Białystok
Activity points
1,493
Well, I used this dll. But as all the interfaces in PC (LPT, RS232) will dissapear in the nearest future I use USB port.
 

farhada

Advanced Member level 2
Joined
Oct 1, 2004
Messages
589
Helped
84
Reputation
168
Reaction score
30
Trophy points
1,308
Location
Nice, France
Activity points
5,025
kekon said:
I wonder why microsoft made it so extremely difficult to control such simple device as LPT port ! To control it in a "legal way" under windows (from Delphi, C-Builder, Visual C etc.) one needs to find special drivers even if it's only setting single D0..D7 pins to desired state.

I would say mainly because MS does not want people to directly access HW. Their dream is to create a PC like Machintosh was in the early 80s, impossible to interface and a dummy unit for 99% of the users, they don't care about the geeky 1% who wants to access HW!

BR,
/Farhad
 

AsAdi1970

Newbie level 6
Joined
Feb 13, 2005
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Kerman-Iran
Activity points
134
you can use this drive free,there are some examples included.
Thanks to Yarin Kaplan for his free driver.
 

intrepido

Junior Member level 2
Joined
May 4, 2004
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
101
You can use a samples when you (from jungo driver) install windriver.
There are 2 examples.
The first is without interrupt the second with interrupt.
Hi
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top