LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   parallelport IO (https://www.linuxquestions.org/questions/programming-9/parallelport-io-600468/)

Four 11-17-2007 05:34 PM

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.

theNbomr 11-17-2007 06:32 PM

You need to connect the PC parallel port ground pin(s) to the external device's ground (-).
--- rod.

Four 11-17-2007 07:05 PM

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?

PAix 11-17-2007 08:48 PM

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

Four 11-18-2007 09:44 AM

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.

PAix 11-19-2007 08:18 AM

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

Four 11-21-2007 12:06 AM

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 :)


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