JK02 Ports and Pins Config in Mach3

Configuring Mach3 to run the JK02-M5 Breakout board.

These instruction will explain how to configure the MACH3 Software to run your JK02-M5 Breakout board and Stepper Motors

Operating System

Currently Mach3 is know to work with all 32bit versions of Microsoft Windows. Mach3 does not work with LPT drivers in 64Bit versions of Windows, but additional hardware (Motion controller) can be used to overcome this (approx cost $150). I know people have got this working with LINUX but I have no experience with it to advise you on it’s use


The minimum requirement is a desktop PC with 1Ghz CPU, 512Mb of RAM and a 32Mb Video card. Laptops are not recommended as the LPT output voltage is 3v-3.6v which does not power the TB6560’s breakout board correctly. This can manifest itself as limit/e-stop not working, and in some cases the X axis not working. Again a motion controller will overcome these issues on a laptop.

Basic Concept

In a nutshell Mach3 uses the Local Printer Port to communicate with the JK02-M5 Breakout board via a Parallel cable. However it slightly more complicated than that, Mach3 talks to Windows and uses it’s LPT Driver. The Driver then gives or interprets signals sent in and out from the individual pins on the LPT connector itself (D-SUB 25 connector). On the JK02-M5 is also an LPT connector which is connected to a breakout board controller and then on to the Stepper Motor Driver Units.

Pins and Ports

Pins and Ports refers to the LPT “Port” configured in Windows and and the actual signal
sent down each wire (Pin) of the LPT cable.

JK02-M5 Driver board Pin Outs

The JK02-M5 Breakout board has the following Pin Outs/Ins through it’s D-SUB 25 Connector, Pin:

  1. Enable Signal
  2. X Axis Step
  3. Y Axis Direction
  4. B Axis Step
  5. A Axis Direction
  6. A Axis Step
  7. Z Axis Step
  8. Z Axis Direction
  9. Spindle Motor
  10. Input 1 (X Limit)
  11. Input 2 (Y Limit)
  12. Input 3 (Z Limit)
  13. Input 4 (A Limit)
  14. X Axis Direction
  15. Input 5 (E-Stop)
  16. Y Axis Step
  17. B Axis Direction
  18. Ground
  19. Ground
  20. Ground
  21. Ground
  22. Ground
  23. Ground
  24. Ground
  25. Ground

Windows LPT Port Settings

Please check your LPT port’s base address in Windows. User your user guide for your version of Windows, it will be in “Device Manager”. If Mach3 is not configured with the correct information your JK02-M5 Breakout board won’t function.

Looking at the line “ECP Printer Port (LPT1)” tells us 2 things, in your computers BIOS the printer port is set to the ECP protocol, and, it is Port 1 (from LPT1) on the PC’s serial/parallel bus. Further down is “Resource type” and “Setting” We need the first line that lists I/O Range (memory input / output address range) and the setting that follows. In this example it is “03BC” is the start address.

Action: If it does not say it is an ECP port you will need to look up how to change it in your BIOS (this will usualy require a re-boot and hitting F1 or DEL during POST, please refer to your PC’s manual)

Information to continue on:

Port = 1

Port Address = 03BC

Configuring Mach3 to work with the JK02-M5 Breakout board’s pin-outs.

What has to be done from here is to tell Mach3 what printer port and which pins to run what device on the JK02-M5 so it can interpret and send signals correctly. 

Open Mach3 (Mill), go to the “Config” menu and select “Ports and Pins”

Configure Port

The first tab is “Port Setup and Axis Selection”, on this page we need to set up the Port number, Base address for the LPT port and it’s communication speed. In this example we are using LPT1, at “Port #1” check the box to indicate information will be coming in on Port 1. At “Port Address” enter in your base address, in this example we are using 03BC. Once you hit the “Apply” button Mach3 will add an “x” between the first and second digit, I don’t quite know why it is done, but 03BC becomes 0x3BC. If you are using the Demo version of Mach3 your Kernel speed is restricted to 25000Hz. 

Configure Pins for Axis (Stepper Motors)

The next tab is “Motor Outputs”, this is where we tell Mach3 what pins to monitor in order to move a stepper motor. From our JK02-M5 table we know PIN:
2 is X Axis Step
14 is X Axis Direction
16 is Y Axis Step
3 is Y Axis Direction
7 is Z Axis Step
8 is Z Axis Direction
6 is A Axis Step
5 is A Axis Direction
4 is B Axis Step
17 is B Axis Direction

Enter the correct Pin number into the table next to the corresponding Axis, “Port” number is always going to be “1” as we only have one port. In the “Enabled” column, click the red “X” until it changes to a green tick. Enabling and item activates it for use in Mach3. You can also use these panels to stop using an item, simply hit the green tick in the “Enable” column and it will revert to a red “X”, the settings can remain.

The above panel told Mach3 which pins make the motor move and in what direction. In addition to this there is an actual on/off function which is in the “Output Signals” Tab. Using The JK02-M5 pin-out table again we know that Pin: 1 Enables/Disables the all Axis

“Enable1” to enabled (Green tick) on Port 1 using pin 1,
“Enable2” to enabled, port = 1 and Pin = 1,
“Enable3” to enabled, Port = 1 and Pin = 1.
“Enable4” to enabled, port = 1 and Pin = 1, and,
“Enable5” to enabled, Port = 1 and Pin = 1.

Enabling The Relay circuit

On the above panel is a field called “Output #1”, this is the configuration for the JK02-M5’s onboard DC relay. Again from the JK02-M5’s pin-out table we can see pin 9 is connected to that relay. To allow Mach3  to enable/disable it, change the red “X” to a green tick in the “Enable column next to “Output #1”, “Port” to 1 and Pin Number to 9. Click “Apply” in the bottom right corner to save and “OK” to exit the menu.


You should now be able to test your setup. At the Mach 3 Window, press the “Tab” key and the virtual “Jog Pendant” should apparel on the right side of the screen.

Use the X+, X-, Y+, Y-, Z+ and Z- arrows to move your cutting head around.

Supplementary Images


Next Step

You are now ready to move onto the next step: