Go to Post I'm sure an inflatable Dean Kamen action figure would be quite the sight around the home. lol - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-01-2006, 22:34
f4cepl4nt f4cepl4nt is offline
Registered User
no team
 
Join Date: Jan 2006
Location: Tdot
Posts: 1
f4cepl4nt is an unknown quantity at this point
PC Parallel Port Circuit

Hey everyone, I have a PC related question, so hopefully I put this in the right forum.

You know how you can use your computer to set the status of your parallel port pins? EG 0-+0.7V on a data pin is logic '0', and +2.4 - +5V on a data pin is a logic '1'. You also know how you can use these pins and the ground pins to power electric circuits? Well I was wondering how to externally set the pins to a logic 1 or 0, using a circuit. I want to know because I need to make a receiver for a laser communicator device and I need to be able to set the status of a pin (to be read by the computer) using an electric circuit.

Thanks
  #2   Spotlight this post!  
Unread 02-01-2006, 22:51
Tom Saxton's Avatar
Tom Saxton Tom Saxton is offline
Registered User
no team (Issaquah Robotics Society)
Team Role: Mentor
 
Join Date: Dec 2003
Rookie Year: 2003
Location: Sammamish, WA
Posts: 98
Tom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud ofTom Saxton has much to be proud of
Re: PC Parallel Port Circuit

Typically, you'd ground your circuit with the ground pin on the parallel port. Then to set a data pin to zero, you'd connect that pin to the shared ground. To set it to 1, connect it to +5V relative to shared ground.

I haven't done much with parallel ports, but I'd also expect that you'd want to set the pin you're fiddling with to be an input, so the PC isn't also trying to set the pin value.

As an added safety, you probably want to connect the pin to ground or +5 through a resister so you limit the current that flows if something goes wrong.

Maybe this answered your question, or maybe you already know what I just said and are asking how to accomplish the connections. To answer that, I'd need to know what you're working with. For example, it's easy to do if you have a programmable microprocessor on your circuit board.
__________________
Tom Saxton
http://www.idleloop.com/
  #3   Spotlight this post!  
Unread 02-01-2006, 22:52
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: PC Parallel Port Circuit

Yes. Sort of. It is quite easy to bit bang the pins of the parallel port. The reason I say sort of is your desire to power something. It depends on how much power you are trying to pull. I think you can get away with small power needs but power hogs are another matter.

KitsRUs.com sells a PC Data Acquistion Kit (available here) that I have used with good success.

Even if you don't want to use the kit (and you probably don't have to), it has a manual that shows a BASIC program that demonstrates how to access the various data & control signals of the parallel port.

The code is a bit criptic but if you are clever and know a bit about HEX you can noodle through it.

Quote:
a typical code example - line numbers are for reference

1. PORT = &H378
2. PE = 32
3. OUT PORT, &H00
4. OUT PORT, &H02
5. OUT PORT, &H00
6. OUT PORT, &H01
7. BITS = 0
8. X = INP (PORT+1) AND PE
9. IF X = PE THEN BITS = 128
10. FOR I% = 6 TO 0 STEP -1
11. OUT BASE, &H03
12. OUT BASE, &H01
13. X = INP (PORT+1) AND PE
14. IF X = PE THEN BITS = BITS + (2 ^ I%)
15. NEXT I%
16. PRINT BITS
Another nice thing about the manual is that it gives all the secret handshakes to get things to works (address of the various registers, etc.)

Good luck.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #4   Spotlight this post!  
Unread 02-01-2006, 23:10
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: PC Parallel Port Circuit

Quote:
Originally Posted by Joe Johnson
It depends on how much power you are trying to pull. I think you can get away with small power needs but power hogs are another matter.
I just did a bit of digging. The parallel port doesn't seem to have a power pin. You will have to steal power from an I/O pin. The spec on the port is 12mAmps at 2.5V. This is not a lot to work with. You may get more on a particular implementation, but you can't count on it.

This Book gives a great example of how to steal power from the parallel port (I recommend the book too by the way, but it is sort of a specialty product).

They recommend a MAX756 step up DC-DC converter. For what it is worth.

To me it seems like a lot of bother. I would just steal power from a nearby USB port which has a nice juicy 5V pipe ready to supply your current hungry needs!

Finally, have you thought about data rates? How fast are you trying to do things (or how fast is the signal you need to service?) ? This matters because Windows can be more or less counted on to insert random 60-100msec delays at times when you need them least.

Think about it before you get too far down this path.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #5   Spotlight this post!  
Unread 03-01-2006, 08:12
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: PC Parallel Port Circuit

With a modern multitasking operating system like windows XP, using the parallel port is a pain. That's why serial async has taken over. You might want to consider using a PIC and a serial or USB connection and pass commands and packets over the buffered serial busses. The PIC would give full control of the device, However for high data rates your going to need to go to programmable DSP's- nasty.
  #6   Spotlight this post!  
Unread 03-01-2006, 12:48
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: PC Parallel Port Circuit

Quote:
Originally Posted by Gdeaver
With a modern multitasking operating system like windows XP, using the parallel port is a pain.
Since this was mentioned, I'll note that any of the NT-series operating systems do not permit direct access to the parallel port (over port 378h, for instance). They instead require that a driver be used, which has kernel-mode access; the software will interface with the driver, instead of directly altering port states.

There are lots of third-party software components which streamline this access and encapsulate it into an ActiveX, .NET or other (e.g. VCL for Delphi) component. Finding a free one of those might be necessary, unless you like the prospects of running MS-DOS 7.11 or Windows 98, in real- or protected-mode.
  #7   Spotlight this post!  
Unread 03-01-2006, 13:13
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: PC Parallel Port Circuit

Quote:
Originally Posted by Tristan Lall
...There are lots of third-party software components which streamline this access and encapsulate it into an ActiveX, .NET or other (e.g. VCL for Delphi) component. Finding a free one of those might be necessary....
It is really pretty easy to port the code in the parallel port kit's manual listed above to Visual Basic.

I think it only took me about an hour or two to get it up and running in VB.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
  #8   Spotlight this post!  
Unread 05-01-2006, 22:04
Venkatesh Venkatesh is offline
Registered User
FRC #0030
 
Join Date: Jan 2003
Rookie Year: 2002
Location: USA
Posts: 260
Venkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to beholdVenkatesh is a splendid one to behold
Re: PC Parallel Port Circuit

There is a driver floating around the net called GiveIO that allows some degree of direct port access under NT operating systems. I have used it with QuickBASIC and FreeBASIC with good success.
__________________
-- vs, me@acm.jhu.edu
Mentor, Team 1719, 2007
Team 30, 2002-2005
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Circuit design help - power supply - Non FIRST Josh Siegel Electrical 31 24-12-2005 13:47
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
Updated: Serial Port Driver Code Kevin Watson Programming 4 05-02-2005 18:39
New Serial Port Driver Kevin Watson Programming 16 09-01-2005 01:56
QBASIC, Parallel Ports, and Windows XP Venkatesh Electrical 1 21-03-2004 19:07


All times are GMT -5. The time now is 10:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi