Continue to Site

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.

Please help me with parallel ports! Thanks!

Status
Not open for further replies.

bulletrick

Newbie level 1
Newbie level 1
Joined
Jan 26, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
12
Hello. I just want to ask anyone the specific codes in Turbo C++/ Borland C++ to separately output a signal to the D0 - D7 pins of the parallel port.

My problem is that when i turn one pin ON, all other pins are also ON!

Please help... Thanx!
 

you must do read , modify and write operation

try this . i dont know Turbo C port access function prototypes ,

so i used pseduo types outp( int portAddr , BYTE value ) BYTE inp( int portAddr )



void SetBit( BYTE bitNO )
{
BYTE mask = 1 >> bitNO ;
outp( portADDR, inp(portADDR) | mask );
}

void ClearBit ( BYTE bitNO )
{
BYTE mask = 1 >> bitNO ;

outp( portADDR, inp(portADDR) & ( ~mask ) );
}
 

good reply depends on the OS you have
 

try this one

here is the way to interface in C language

h**p://www.embeddedtronics.com:80/public/Electronics/minidaq/userport/UserPort.zip

download this file and unzip it

then copy Userport.sys to WINDOWS\SYSTEM32\DRIVERS

then run USERPORT.EXE

u will get a message driver started

Now u do programming in C/C++/JAVA and interface in XP or other version of Windows.

this one worked with me,for parallel port tutorials see
www.bibinjohn.tk
 

have you tried ANDing/ORing the bits?? to turn on bits, OR it with 1 and leave the rest with 0. to turn off bits, AND it with 0 and leave the rest with 1.

i hope i understood and answered your question.
 

1- **broken link removed** --> borland
2- **broken link removed** --> various language
3- take a llook to attach.
 

see this code

#include<dos.h>
void main()
{
outportb(0x378,0x02);
}

first u put userport in my previous post
then u run my programs given in my book, i explained full on that book, there is a section named getting started atleast read that one.
 

Also visit 'beyondlogic.org.' for a good explanation and sample code.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top