Software > Software
parallel port problem
(1/1)
vbnandu86:
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.
iNFINITE:
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.
--- End quote ---
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
vbnandu86:
thanks infinite!!! you were infinitely helpful!!!!!! ::)
Navigation
[0] Message Index
Go to full version