Next: 6.2 Configuring EMC Up: 6.1 Parallel Port Connection Previous: 6.1 Parallel Port Connection Contents Index

## 6.1.1 Setting up Stepper Motors

Currently the EMC supports stepper motors with a 2-bit step-and-direction interface, with bits mapped to the parallel port. Each parallel port has 12 bits of output and 5 bits of input. The outputs are used to drive the step and direction of each motor. 12 bits of output mean that up to 6 stepper motors can be controlled. The inputs can be used to detect limit or home switch trips. 5 bits of input mean that only one axes can get full positive, negative, and home switch inputs. The EMC mapping compromises for 3 axes of stepper motor control, with all positive limit switches being mapped to one input, all negative limit switches being mapped to another input, and all home switches being mapped to a third input. Other permutations are possible, of course, and can be changed in the software. You could also add 2 additional parallel ports (LPT2, LPT3), and get 36 bits of output and 15 bits of input. Some parallel ports also let you take 4 outputs and use them as inputs, for 8 outputs and 9 inputs for each parallel port. This would let you get 3 axes of control and full switch input per parallel port. See Using the PC parallel port for digital I/O for more information on the parallel port.

The pin outs for the EMC stepper motor interface using the first parallel port
Only Step/Dir function is available with steppermod, whilst all options can be used with freqmod and smdromod.

The bracketed numbers for the Two Phase function refer to the connections on a Bridgeport BOSS driver.

IO Pin | `Function` | Function | Function | Function
| Step/Dir | Quadrature | Two phase | Four phase
`D0, pin 2` | X direction | X CW | X Phase 0 (P19) | X Phase 0
`D1, pin 3` | X clock | X CCW | X Phase 1 (P13) | X Phase 1
`D2, pin 4` | Y direction | Y CW | Y Phase 0 (P19) | X Phase 2
`D3, pin 5` | Y clock | Y CCW | Y Phase 1 (P13) | X Phase 3
`D4, pin 6` | Z direction | Z CW | Z Phase 0 (P19) | Y Phase 0
`D5, pin 7` | Z clock | Z CCW | Z Phase 1 (P13) | Y Phase 1
`D6, pin 8` | A direction | A CW | A Phase 0 (P19) | Y Phase 2
`D7, pin 9` | A clock | A CCW | A Phase 1 (P13) | Y Phase 3
`C0, pin 1` | B direction | B CW | B Phase 0 (P19) | Z Phase 0
`C1, pin 14` | B clock | B CCW | B Phase 1 (P13) | Z Phase 1
`C2, pin 16` | C direction | C CW | C Phase 0 (P19) | Z Phase 2
`C3, pin 17` | C clock | C CCW | C Phase 1 (P13) | Z Phase 3
`S3, pin 15` | X/Y/Z/ lim + | X/Y/Z/ lim + | X/Y/Z/ lim + | X/Y/Z/ lim +
`S4, pin 13` | X/Y/Z/ lim - | X/Y/Z/ lim - | X/Y/Z/ lim - | X/Y/Z/ lim -
`S5, pin 12` | X/Y/Z/ home | X/Y/Z/ home | X/Y/Z/ home | X/Y/Z/ home
`S6, pin 11` | Probe | Probe | Probe | Probe
`S7, pin 10` | spare | spare | spare | spare

Pin out for the second parallel port - Used with bridgeportio.
IO assignments can be changed within the ini file.

`IO Pin` | `Function`
`D0, pin 2` | `Spindle reverse`
`D1, pin 3` | `Spindle Forward`
`D2, pin 4` | `spare`
`D3, pin 5` | `Spindle on`
`D4, pin 6` | `spare`
`D5, pin 7` | `spare`
`D6, pin 8` | `Mist Coolant`
`D7, pin 9` | `Flood coolant`
`C0, pin 1` | `Speed decrease`
`C1, pin 14` | `Speed increase`
`C2, pin 16` | `Estop output`
`C3, pin 17` | `Spindle brake`
`S3, pin 15` | `spare`
`S4, pin 13` | `Estop input`
`S5, pin 12` | `Lube input`
`S6, pin 11` | `spare`
`S7, pin 10` | `Spare`

Stepper motor control is implemented using a second real-time task that runs at 100 microseconds. This task writes the parallel port output with bits set or cleared based on whether the a pulse should be raised or lowered. This gives an effective period of 200 microseconds for a full up-and-down pulse, or a 5 kilohertz frequency.

Next: 6.2 Configuring EMC Up: 6.1 Parallel Port Connection Previous: 6.1 Parallel Port Connection Contents Index