Reading Input from LPT-Port

Hello and first sorry for my english :blush:

I'm trying to understand how to read Data from the paralel-Port of my Linux machin...

The Idea: I have an linuxcnc running, which provides stepper signals on the LPT-Port. For each of the three axis there are two pins:

  1. direktion (either high or low)
  2. step (whenever this signal comes the motor should do one step)

While i understand how to read the data for direktion, i can not find a solution, how i read the step data... While thinking about this problems i have come to two solutions 1. Use Interrupts, whenever the status of the step pin changes run a subroutin to do a step 2. use a loop which timing is the same as the duration of the signal.

Are my ideas right or is there another way which I as a beginner, do not think about. If you have interesting links for this topic please tell me, so i can understand more of this material.


If you wire things up suitably you will be able to read all 6 pins with a single Arduino read of the relevant Arduino port. See

I would be surprised if the data from the PC is so fast that you could not read it without using interrupts.

What is the fastest that the step pin changes?

I guess it's possible that the step pulse is very short (even if it's not very frequent) so that it may be possible for the Arduino to miss it between two successive reads. In that case you would need to use interrupts.

You haven't said why you are trying to do this and I wonder if it would be easier to get the PC to pass higher-level data to the Arduino? What is the Arduino going to do with the data - it doesn't have the capacity to store much of it.

If you want to use the Arduino to control the stepper motors there are ready-made solutions for that.



thank you for the answer. Why iā€™m trying this is in main for learning. I Know that there are out of the box solutions for this problem, but i take this to get some experience how to read higher speed signals.

The main goal for me is some time to get the arduino to interpret g-code. But till i understand how to draw a circle in linear steps by getting the radius and the sart and end-point this is my first try to get a working CNC with arduino :smiley:


I don't understand the widespread enthusiasm for interpreting GCode on an Arduino (e.g. GRBL and the various REPRAP boards) when it is so much easier to do it on a PC and just send the required numbers of steps for each motor to the Arduino.


Just to understand how it works 8) That's all ;)

But when sending the numbers of steps from the PC we come to my first problem, that i get Data on the i.E. prallel oder serial interface which i have to read out, or do you have something different in mind?

I don't understand your question so this is just a guess at an answer ...

The PC sends the data to the Arduino over the regular USB connection. Sending data that way appears as a serial port to the software on the PC.