LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-17-2007, 05:34 PM   #1
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
parallelport IO


Hey,

I connected my parallelport to bread board which then passes through a buffer (4050), 20Kohm of resistance and into a self powered device (Altera DE1 board).

two things I'm conserned is shouldn't the circuit be in a loop I only got one wire sticking out of the parallel port?

Secondly I get random noise; everyonce in a while There is random 1's and 0's are detected and takes a while to be stable again. I don't touch the wires and don't know why this happens. I just leave come back the LED's that say 1/0 is interpreted are just flashing back and forth. Eventually the circuit becomes stable and I get clear signal.

Thanks.
 
Old 11-17-2007, 06:32 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You need to connect the PC parallel port ground pin(s) to the external device's ground (-).
--- rod.
 
Old 11-17-2007, 07:05 PM   #3
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
This must be the most retarded question. How do I connect the ground pins of parallel port to the device? And do I do all the ground pins on the parallel port?

The device is an fpga and has an external plug to power it. I don't know where is the ground. Should I set a pin on the FPGA to a low (0) and connect that to a common ground?
 
Old 11-17-2007, 08:48 PM   #4
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
The shell of the parallel port is likely to be at ground (0V), however .
Quote:
D type 25 pin connector, pins 18 - 25 should be at ground.
Centronics connector, pins 19 - 30 should be at ground.
Parallel spec
On your fpga, you say that it has an external plug to power it. Positive and Negative poles - one of these coaxial 2.1mm or jobbies or similar? If there is only one supply voltage on the fpga board, then it's the other one(?) supply and earth/ground (positive and negative).
The whole point is analogous to a battery and bulb. You connect the positive end of the battery to the bulb and nothing happens. The circuit needs an earth return to complete the circuit.
The idea of forcing a pin low and using that is BAD, I don't suppose that there should be much current flowing, but it really needs to be effectively a chassis to chassis connection for the earth reference.
Rule 1, if you aren't comfortable, then get someone local to check that you aren't about to make a costy mistake, any smoke disconnect pronto. It used to be many years ago that the separate earths on Centronics connectors wouldn't be made, just one to make the circuit continuity and the ommitted ones well you will notice that they are between the signals on the cable (ribbbon) and when earthed gave a degree of protection from crosstalk - omitted for cheapness.

You only need one ground connection between the two devices to complete your circuit. Check back if you're not certain.

Believe me, the retarded option is not asking the question and just pushing on regardless with a chance that your kit will pass the smoke test with an expensive smell of burning.

PAix

Last edited by PAix; 11-17-2007 at 08:50 PM.
 
Old 11-18-2007, 09:44 AM   #5
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
Thanks,

I found how to ground properly and now my circuit produces more "clean" digital signals.

Last question: When I short circuit pin 10 and pin 2 on the parallel port(25-pin version) and set pin 2 to high by writing 1 to 0x378. Reading 0x379 always is 120 base 10. I don't seem to be getting any inputs.

I don't understand why?

Edit:
Connecting directly to parallel port (Not through the parallel port cables) seems to work properly for reading.

Last edited by Four; 11-18-2007 at 10:55 AM.
 
Old 11-19-2007, 08:18 AM   #6
PAix
Member
 
Registered: Jul 2007
Location: United Kingdom, W Mids
Distribution: SUSE 11.0 as of Nov 2008
Posts: 195

Rep: Reputation: 40
Looking at your edit, are you saying that it works without the cable, but not with? if so, then it's either a bad cable or you are misinterpreting the pins on the far end of the cable, perhaps by counting from the wrong end, hands up anyone that hasn't done it (we all know it's almost impossible to read the numbers).

Often the ack pin(10) is ignored and the result taken on faith, but it is traditional to set up your data and then pull the strobe pin(1) low. The value of the data being read on the rising edge of the strobe as it goes back high. This info is all available in the "Centronics Handshake" diagram and text in the link I gave to you in my earlier post. Looking at the diagram, you shouldn't be pulling the ack pin(10) anywhere, it it a pin that would normally be read, not set. On your input. set up your data levels then pull the strobe low. However notice the note on the pinout table that says the pin is hardware inverted. Essentially check that it is not normally low and needs pulled momentarily high. I hope that has been of some help to you. You didn't mention if the grounding was essentially as described?

PAix
 
Old 11-21-2007, 12:06 AM   #7
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
I borrowed a different cable from the lab and it works now. Today I read the pins backwards and got inputs/outputs in wrong wholes.

maybe I should follow standards and pull strobe as appropriate. But I'm also building the device I'm communicating to ...

Thanks for your help
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallelport communicate using asm LongName Programming 4 08-29-2004 10:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration