VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time ]
Subject: Re: using PARALLEL PORTS to measure ac and dc voltages


Author:
narender
[ Next Thread | Previous Thread | Next Message | Previous Message ]
Date Posted: 07:01:50 08/17/05 Wed
Author Host/IP: 219.64.67.58.HYD-CDMA.dialup.vsnl.net.in/219.64.67.58
In reply to: Ismail Nasar 's message, "ON THE PARALLEL PORTS IN C LANGUGE USEING WINDOW 98" on 06:54:26 07/25/05 Mon

hello sir, i am doing a study project to measure ac or dc voltages in a computer using pc's parralel port and the code written in c language. the problem is that i have to read 8 bits but parallel port has only 5 input bits. and also how to convert that read binary digits using c language into voltage . can u please help me with a good sample program explaining the above program.

i will be very thankfull to u if u can help me with a circuit diagram and the necessary code for this project of u have it or the link where it is available .

please help me.

thank.uu ....

bye


narender






hello it is ismail nasar once again in our fourm
>tigerpk.tk
> PC parallel port can be very useful I/O channel for
>connecting your own circuits to PC. The PC's parallel
>port can be used to perform some very amusing hardware
>interfacing experiments. The port is very easy to use
>when you first understand some basic tricks. This
>document tries to show those tricks in easy to
>understand way.
>
>
>DONT ABOUSE ME IF U MAKE MISTAK
>WARNING: PC parallel port can be damaged quite easily
>if you make mistakes in the circuits you connect to
>it. If the parallel port is integrated to the
>motherboard (like in many new computers) repairing
>damaged parallel port may be expensive (in many cases
>it it is cheaper to replace the whole motherborard
>than repair that port). PC parallel port is 25 pin
>D-shaped female connector in the back of the computer.
>It is normally used for connecting computer to
>printer, but many other types of hardware for that
>port is available today.
>
>Not all 25 are needed always. Usually you can easily
>do with only 8 output pins (data lines) and signal
>ground. I have presented those pins in the table
>below. Those output pins are adequate for many
>purposes.
>
>
>pin function
> 2 D0
> 3 D1
> 4 D2
> 5 D3
> 6 D4
> 7 D5
> 8 D6
> 9 D7
>
>Pins 18,19,20,21,22,23,24 and 25 are all ground pins.
>Those datapins are TTL level output pins. This means
>that they put out ideally 0V when they are in low
>logic level (0) and +5V when they are in high logic
>level (1). In real world the voltages can be something
>different from ideal when the circuit is loaded. The
>output current capacity of the parallel port is
>limited to only few milliamperes.
>
> Dn Out ------+
> |+
> Sourcing Load (up to 2.6 mA @ 2.4 v)
> |-
> Ground ------+
>
>
>
>PROBLEM IS THAT HOW WE CALCULATE UR OWN DATA TO BE
>SEND BY PARALLEL PORTS
>You have to think the value you give to the program as
>a binary number. Every bit of the binary number
>control one output bit. The following table describes
>the relation of the bits, parallel port output pins
>and the value of those bits.
>
>Pin 2 3 4 5 6 7 8 9
>Bit D0 D1 D2 D3 D4 D5 D6 D7
>Value 1 2 4 8 16 32 64 128
>
>For example if you want to set pins 2 and 3 to logic 1
>(led on) then you have to output value 1+2=3. If you
>want to set on pins 3,5 and 6 then you need to output
>value 2+8+16=26. In this way you can calculate the
>value for any bit combination you want to output
>
>APPREATUSE TO NEED
>1 PARALLEL PORTS WIRE
>
>2 2LEDes
> 3 BREAD BORD
>here is the programm
>#include
>#include
>#include
>void main (void)
>{
>clrscr();
>printf("the LED 1 should be ON");
>getche();
>outport(888,2); /////the LED conection should be
>with pin3
>printf("the LED 1 shoud be OFF);
>getche();
>outport(888,0);
>printf(the LED 2 should be ON);
>getche();
>outport(888,8); ///the conection of LED1 should be
>with pin 5
>printf("the LED 2 shoud be OFF);
>getche();
>outport(888,0);
>getch();
>}
>as u know the parrlell port send maxiumm 8 volatege
>by a pin which is enough for LED
> the connection of wire should be with one from
>parallel and one from ground the ground provise -ve
>
>
>by this way u can ON LED useing LED
> pray from me
>ismail nasar
>BIT quetta

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Post a message:
This forum requires an account to post.
[ Create Account ]
[ Login ]
[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.