Author Topic: parallel port problem  (Read 4738 times)

0 Members and 1 Guest are viewing this topic.

Offline vbnandu86Topic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
parallel port problem
« on: May 21, 2007, 08:52:22 AM »
i have installed win XP on my system.To enable myself to program using the parallel port,I installled M.S Virtual PC,on that(virtual computer) i have installed Windows 98.
I have been able to output to the parallel port using turbo C++(Borland 3.0) compiler with the following statement.
outportb(0x378,0xff)//This makes all the pins high.
Everythings fine till here.
 :'(..................|||THE PROBLEM|||.............. :'(

i know the pins 10,11,12,13 and 15 can be used for inputting data from the parallel port by giving a logic 1(2.47V to 5 V).i am not able to read the data from any of them.Every time it shows a value of 127 for the following statements.
#include<stdio.h>
#include<conio.h>
#include<dos.h>
 void main() 
{
  int i=0;
  i=inportb(0x379);
  printf("%d",i);
  getch();
}

The multimeter reads 4.8V for the lead i am going to insert into the pin 10.

If anyone can identify where i am going wrong,please reply and any advice is always welcome.


Offline iNFINITE

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
    • iNTBOTS.iNFO | My Homepage
Re: parallel port problem
« Reply #1 on: May 21, 2007, 10:05:01 AM »
You can program the parallel port in XP also,Just install this Userport driver: http://www.embeddedtronics.com/public/Electronics/minidaq/userport/UserPort.zip

Quote
Every time it shows a value of 127 for the following statements.
Correct me if i am wrong: Have you only tried giving 4.8V to pin 10?

Then..
When giving 4.8V to pin 10(S6) ,and the other Status port pins(11,12,13,15) being left unconnected.
so in the status port(0x379):
S7(pin11)=0(as it is hardware inverted)
S6(pin10)=1
S5(pin12)=1
S4(pin13)=1
S3(pin15)=1

S2,S1,S0 are not available for use and they are all high(1)

So ur status port is 0111 1111(binary) =127

Try connecting the pin 10 to gnd, then ur reading should be 0011 1111(binary)=63


Offline vbnandu86Topic starter

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 0
Re: parallel port problem
« Reply #2 on: May 26, 2007, 11:53:37 AM »
thanks infinite!!! you were infinitely helpful!!!!!! ::)

 


Get Your Ad Here