PDA

View Full Version : Parallel ports in wiindows xp



aditya_v
10-08-2004, 01:55 PM
hi my name is aditya.recently after reading the parallel port tutorials here,i decided to experiment it on my comp which is running xp.
I downloaded porttalk22 which opens up any specific port in os like xp.

http://www.robotics.com/porttalk22.zip

now, i wrote a the program in C and compiled it in borland TURBO C 2.01 running as
*****************
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#define port 0x3BC
#define value 0x00
void main(void)
{
outportb(port,value) ;
printf("done!");
getch();
}
******************
The address of lpt1 can be found by running another c program which can be downloaded.
The problem is though the program conmpiles and runs with porttalk perfectly i see no change in value of output in the parrallel port.It always reads 4.51v.
Any help will be much appreciated.Thanks a lot.



Pulkit_gaur
10-08-2004, 03:20 PM
Hi,

Choose the DATA output port.
Change the address to 0x378


-
Pulkit
MIG India

ingenium
10-08-2004, 03:30 PM
windows xp does not allow to access parallel port pins ....
u have to either use windows 98 or u have to use bootble disc.
Subhasis

10-08-2004, 05:29 PM
hi ingenium and pulkit.thanks a lot for answering.i really didn't expect such a fast reply. :D
But i think i have left out a fewthings.I am already using yhe pins 2-9 of lpt1(are those the DATA output pins?).Also i am using a hp computer and am 100% sure that my lpt1 is located at 0x3bc.
and porttalk22 does open up ports on xp.I am not sure if i am llowed to but here's the readme file to it.
-----------------------------------------

Beyond Logic Port Talk I/O Port Driver
http://www.beyondlogic.org

The PortTalk driver combined with allowIO.exe, grants certain programs
exclusive access to IO Ports on a Windows NT/2000/XP system.

Important information for Upgrading PortTalk from V1.x
__________________________________________________ ____

When installing PortTalk V2.0 on machines with an older version
of V1.x, the existing driver must be un-installed. Simply run
uninstall.exe with administrator privileges.

Installing PortTalk V2.0
________________________

The PortTalk usermode programs now come with a self installer.
This is built into allowio.exe and ioexample.exe. When these
usermode programs are executed, a check is made if the PortTalk
driver is started. If the driver is not started it attempts to
install the driver and then start it.

Allowio - Grants programs access to IO Ports.
_____________________________________________

Usage : AllowIO <executable.exe> <Hex Addresse(s)> <Switches>

eg. Using allowio to grant access to IO ports 0x42, 0x43 and 0x61

C:\porttalk\AllowIO>allowio 0x42 0x43 0x61 beep.exe
Beyond Logic AllowIO.EXE
Address 0x042 (IOPM Offset 0x08) has been granted access.
Address 0x043 (IOPM Offset 0x08) has been granted access.
Address 0x061 (IOPM Offset 0x0C) has been granted access.
Executing beep.exe with a ProcessID of 1096
PortTalk Device Driver has set IOPM for ProcessID 1096.

This is more secure than allowing all programs and processes access
to all IO ports.

If you don't know what addresses a certain program uses, you can
grant access to all ports.

C:\porttalk>allowio beep /a
BeyondLogic AllowIO
Granting exclusive access to all I/O Ports
Executing beep with a ProcessID of 524
PortTalk Device Driver has set IOPM for ProcessID 524.

This is less secure. For example the program can talk to COM1
and lock up your mouse.

Craig Peacock
13th January 2002
-------------------------------
All help appreciated.thanks.

Vivek
10-08-2004, 08:08 PM
Hi Aditya,

Though your parallel port may have 3 possible port addresses:
0x3BC, 0x378, 0x278

Im wondering how correct is the output of the C-program which you downloaded ? (which shows you the port-address)

it would be better if you simply see the base address in Bios settings , or through windows xp: as given here
http://asia.cnet.com/enterprise/netadmin/0,39035505,39148944-2,00.htm

if its correct, then you may like to read the beyond logic tutorials and porttalk pages again, in detail.

cheers & goodluck!
Vivek

10-08-2004, 08:18 PM
oh i forgot to mention,
on some machines it is necessary to change the port mode
TO--> "Standard Mode"
from ECP or some thing else.
done In--> Bios settings...
these are usually P4 class machines...

goodluck!

ice
10-08-2004, 11:07 PM
SPP should do...so is EPP...mines on ECP and works like a breeze...
U get a split second boew of ur parallel port address at start up...
On XP...press windows+Pause break

Select the Hardware tab...
Go to device manager.
Select ur Parallel port
go to RESOURSES
and check ur base address.

Now u know ur base address.If thats right ,then there something else going wrong...keep us posted
ice
//Gerry

ice
10-08-2004, 11:12 PM
Hmmmm...didn't read the above posts...Since ur sure ur address is 3BC..

First...
Is ur port working...?

Second...
Not sure....Get someone's printer home and check if the printer is workin..

Third...can't do the second..
I assume ur in an Engg college..Use one of ur lab PC's parallel port.

Ur program is simple .Shoul've worked..How many parallel ports do u have.Most of the time it's one,but sometimes there are 2.

Another thing did u try checking the inputs?
ice
//Gerry

Pulkit_gaur
10-09-2004, 01:49 AM
Hi ,
Try this utility at MIG India :

http://www.migindia.freewebindia.com/downloads

-
Pulkit
MIG India

aditya_v
10-09-2004, 01:58 PM
Hi guys,thnaks a lot for replying.There still seems to be problems .Here's what i did.
I went to this link

http://asia.cnet.com/enterprise/netadmin/0,39035505,39148944-2,00.htm

(thanks to vivek) which gave me almost everytihng i wanted.I chacked the port addresses in the Bios (i got 0x378) the program i downloaded was erroneous.In the Bios there were 3 modes:ECP,EPPandBI-directiona(default was ecp)l.I used bi-directional.Then I changed the parallel port conf. in the device manager and i thought i was ready to go.but i was still getting 4.52v from all the pins in lpt1.
Then i checked this link which says something about a new dll for i/o access
but i think i have to use Vc++ for that.

http://www.logix4u.net/inpout32.htm

but i will use that as a last resort.Maybe i will try epp and see what happens.
Pulkits files also seem to be using inout32.dll.Pulkit can u ad like a browse button to like upload a file directly to the port?also,a confirmation mesg. saying the port has been opened or something?
Also can anyone try porttalk22 on their comp. and tell me if it works or not.It can be found at

http://www.robotics.com/porttalk22.zip

Also ice what do u mean by checking the inputs?I am sure my ports are working fine.
Any suggestions welcome.again,thanks a lot everybody.

aditya_v
10-09-2004, 02:17 PM
ice, u said that u are able use the parallel ports in xp??
What compiler do you use?And how do you open i/o ports?
Thanks.

Vivek
10-09-2004, 05:52 PM
Aditya
I have never used the Porttalk util given on beyondlogic.org but I suggest you get it from there only, and not any other source.
-->http://www.beyondlogic.org/porttalk/porttalk.htm

but i hope..
while measuring the voltages on port, you are-
measuring them "before" pressing the key (while the getch in your code waits for your key-press) and not after the program ends.
--just thought maybe the windows takes the control back after the program ends and resets the port.
dont know what these complicated OSes do.

if thats the case:
i am sorry i cant help you more than this, and can only think what Gerry has suggested. Is your port working ??
hope u havent applied any voltages to it and blown it.

hmm..i stopped using parallel ports since i dont know when...and those were the good days of Dos6 to win95.


cheers & goodluck!

ice
10-09-2004, 06:56 PM
adv,
U know ,life would be much easier if you could run ur stuff on a 98 machine...anyways..no harm in trying on XP..

First ::
Please check if ur port is workin....get hold of a printer .
That will clear our first doubt. :D
I said inputs in my previous post...
I wanted to see if ur port is receiving at least..give a 4.5V to one of the input pins.
http://neil.fraser.name/software/lpt/

dload the above file [lpt.exe].It's a monitor..REMEMBER to ground your circuit to the ppt.

I use 98 to run my interfacing apps.The parallel port Tutorial that i wrote has a program for the inputs..try it out.
Keep us posted..This is a kewl thread :D .Makes us rack our brains.

hey vivek...ur sig homepage isn't in html..will be better for clicking if u make it clickable.
ice
//Gerry [ http://www.machinegrid.com]

yogi
02-08-2005, 05:57 PM
ai u can do interfacing in XP

I have posted it on this site see it in programming section

for parallel port see my tutorials, get it from

www.bibinjohn.tk

senior
02-25-2005, 12:27 AM
Please help me about understanding the effect of this test:
if (getch()==0x00) getch();
I don't understand wath does mean 0x00 and the role of function getch() combinated with 0x00.

please email me at senior_kro@yahoo.com
Thank you...

subot_robot
02-26-2005, 12:06 AM
Hi,
getch() gets a character (from file or keyboard, i am not sure)

0xhh -- here 'hh' is the hexadecimal number and 0x before any number indicates that, that number is hexadecimal number.

if (getch()==0x00) getch();
in the above line, it checks whether the character read is equal to 00 in hexadecimal format. if yes get another character.

subot_robot

yogi
11-22-2005, 07:39 PM
tell which language u want to do????

If you want to do in C/C++/Java
u have to install userport.zip

U can download it from Yahoo gp-parallelport(install by instructions from file pforu)

In VB,VC there are readymade dll's to do it, u can get it from tutorials here


Bibin John
www.bibinjohn.tk

07-19-2007, 04:55 PM
Hello All

I am using Porttalk22 and its working ok. But driver is unable to clear data buffer and so next data is not coming on 0x378. So please tell me how to clear buffer of that driver. help me please its urgent.

Thanks in Advance