pin configuration

A “pin” is an input or output on the board.

In a lot of cases (step/direction for external stepper motors, button inputs), you can use any pin for any use. In other cases, a given pin is tied to a given peripheral on the board.

Choose a pin that is free and can do what you need. A button needs an input. An external stepper driver needs output pins. Hardware PWM and serial need pins that support those functions. See the pinout for your board.

Add modifiers after the pin name. For example, 1.19! on V1 or PA4! on V2 inverts the input or output. The pin name on your board may be different. For example:

my_pin_name 1.19!
my_pin_name PB3!

There are other modifiers for pins:

Modifier Symbol What it does
Invert pin ! Inverts the input or output. Exclamation mark
Open drain o Selects open drain for an output. Lowercase O letter
Pull up ^ Turns on the internal pull-up on an input. Caret, Shift+6 on QWERTY keyboards (default on most pins)
Pull down v Turns on the internal pull-down on an input. Lowercase v letter
No pullup - Turns off both internal pulls. Minus sign
Repeater mode @ Holds the last input level weakly, on V1 only. At / Arobase sign
No modifier   If you do not set any modifier, the pin is in pull-up mode, as if it had ^ specified
Some pins have hardware on the board itself, enforcing a given configuration.

The main example of this is the endstop inputs, which have on-board pull-up resistors, meaning trying to deactivate pull-ups in configuration (- for them) will not work (configuration cannot deactivate/remove physically present pull-up resistors, it can only act on pull-up pin-configuration peripherals "inside" the chip).

Inputs normally default to pull-up. Some boards have resistors on the PCB, for example on endstop inputs. The pin modifier changes the pull inside the chip. Check the actual board if you need to change what an unplugged input reads.

Understanding Pin Modes

The following sections explain what each pin mode means and when you would use it in your 3D printer or CNC mill setup.

Open-Drain Mode (o)

Open-drain circuit

What it is: An open-drain pin is like a switch that can only connect to ground (0V) or disconnect completely. Think of it like a light switch that can only turn the light off or leave it “floating”: it cannot actively turn the light on by itself.

How it works: When the pin is active, it connects to ground (pulls the voltage down to 0V). When inactive, it simply disconnects and lets other components control the voltage on that wire. A pull-up brings the wire high when every output has let go.

Why it matters for 3D printers/CNC: Open-drain is useful when multiple devices need to share the same signal wire. For example:

  • Multiple endstops on one pin: if you wire several endstop switches in series, they can all share one input pin using open-drain. When any switch triggers, it pulls the signal to ground.
  • Shared alarm signals: when multiple devices need to signal an error condition on the same wire. Any device pulling the wire low is enough to signal.
  • Level shifting: when connecting 5V devices to 3.3V pins, open-drain lets you interface between different voltage levels, as long as the pull-up voltage is safe for every pin on that wire.

When to use it: Use open-drain (o) when you need to connect multiple switches or sensors to a single pin, or when interfacing with devices that expect open-collector/open-drain outputs. Check that the pull-up voltage is safe for every pin on that wire.

Pull-Up Mode (^)

Pull-up resistor circuit

What it is: A pull-up resistor is like a weak spring that gently pulls the pin voltage up to 3.3V when nothing else is controlling it. It’s the default mode for most pins on the Smoothieboard. A pull-up keeps an input high until something pulls it down.

How it works: Inside the microcontroller chip, there’s a resistor (typically around 50kΩ) connected between the pin and the 3.3V power supply. This resistor is “weak”: any external signal can easily override it. When you connect a switch or sensor that pulls the pin to ground, it wins over the pull-up resistor.

Why it matters for 3D printers/CNC: Pull-up mode is the standard way to connect switches and sensors:

  • Endstop switches: when the switch is open (not triggered), the pull-up keeps the pin at 3.3V (high). When the switch closes, it connects the pin to ground, reading as 0V (low). Use ! if the firmware needs to treat low as active. See setting up endstops for checking what the firmware actually reads.
  • Thermistor connections: many temperature sensors work with pull-up resistors to create a voltage divider.
  • Simple wiring: you only need two wires to your switch, one to the pin and one to ground. No separate power wire needed.

When to use it: Use pull-up (^) for most switches, buttons, and sensors. This is the default and works for the majority of inputs on a 3D printer or CNC mill. If you don’t specify a modifier, the pin automatically uses pull-up mode.

Hardware vs. Software Pull-ups: The pull-up mode described here is configured internally inside the microcontroller chip through software. However, some pins on the Smoothieboard have physical pull-up resistors soldered directly on the PCB itself. For example, endstop inputs have hardware pull-up resistors on the board, which means they will always function as pull-ups regardless of your configuration settings. You cannot disable hardware pull-ups through software - the physical resistors on the board will override any configuration you set.

Pull-Down Mode (v)

Pull-down resistor circuit

What it is: A pull-down resistor is the opposite of pull-up: it’s like a weak spring that gently pulls the pin voltage down to 0V (ground) when nothing else is controlling it.

How it works: Instead of connecting to 3.3V, the internal resistor connects between the pin and ground. The pin reads as 0V (low) by default, and only reads high (3.3V) when something actively drives it high. The pin and board still need to support the signal’s voltage.

Why it matters for 3D printers/CNC: Pull-down is less common but useful in specific situations:

  • Active-high sensors: some sensors output 3.3V when triggered and disconnect when not triggered. Pull-down ensures the pin reads 0V when disconnected.
  • Normally-closed switches: if you are using a switch that is closed by default and opens when triggered, pull-down can simplify your wiring.
  • Positive logic preference: when you want the pin to read “low” in the idle state and “high” when activated.

When to use it: Use pull-down (v) when connecting sensors or switches that provide a positive voltage when active, or when you specifically want the opposite behavior of pull-up mode. This is relatively rare in typical 3D printer setups.

Hardware vs. Software Pull-downs: The pull-down mode described here is configured internally inside the microcontroller chip through software. Be aware that some pins on the Smoothieboard may have physical pull-up or pull-down resistors soldered directly on the PCB itself. If a pin has hardware resistors on the board, they will determine the actual pull behavior regardless of your software configuration. Always check the board's schematic or documentation to confirm whether a specific pin has hardware pull resistors before relying on software pull-down configuration.

Repeater Mode (@)

What it is: Repeater mode is a hybrid that tries to “remember” the last signal it saw and weakly hold it there. It acts like both a pull-up and pull-down at the same time, maintaining whatever state the pin was last in. On V1 the repeater holds the last level weakly after the signal stops driving the pin. Smoothie V2 does not support repeater mode.

How it works: The pin has circuitry that detects whether the last signal was high or low, then uses a weak resistor to keep it in that state. If the pin was pulled high, it acts like a pull-up. If it was pulled low, it acts like a pull-down. It “repeats” the last state it saw.

Why it matters for 3D printers/CNC: Repeater mode is useful in specific edge cases:

  • Long wire runs: when you have very long cables (several meters) that might pick up electrical noise, repeater mode helps maintain signal stability.
  • Floating inputs: when a pin might be disconnected temporarily but needs to maintain its last known state.
  • Reducing noise: the weak holding force helps filter out brief noise spikes on the wire.

When to use it: Use repeater mode (@) when you have long cables prone to noise, or when you need a pin to maintain its state even when the signal source briefly disconnects. This is the least commonly used mode in typical 3D printer or CNC setups, most users will never need it. Use a pull-up or pull-down if you need a predictable state when the wire is open.

Advanced Users Only: Do not use repeater mode unless you fully understand how it works and have a specific reason for it. This mode can cause unexpected behavior, especially during power-up or reset conditions when the pin state is undefined. Most users should stick with pull-up (^) or pull-down (v) modes. Do not enable repeater mode simply because you think it will "make things better" - it is designed for very specific edge cases and is rarely needed in typical configurations.

Combining Multiple Modifiers

Important: You can use multiple modifiers on the same pin by placing them one after another. The pin configuration system allows you to combine different flags to achieve exactly the behavior you need.

Put the modifiers next to one another after the pin name, for example 1.24!^ on V1 or PD0!^ on V2. The pull-up is still a pull-up. The inversion changes what the firmware reads.

my_pin_name 2.11!o^

In this example, pin 2.11 is configured with:

my_pin_name PC7!o^

In this example, pin PC7 is configured with:

  • ! - Inverted output
  • o - Open-drain mode
  • ^ - Pull-up enabled

Common Useful Combinations

Here are some practical combinations you might use in your 3D printer or CNC setup.

1. Inverted with Pull-up (!^)

endstop_pin 1.24!^
endstop_pin PA5!^

This is extremely common for endstops. The pull-up keeps the pin high (3.3V) when the switch is open, and the inversion means the firmware reads this as “not triggered.” When the switch closes, the pin goes to ground, and the inversion makes the firmware read it as “triggered.”

Why it’s useful: Many endstop configurations expect the opposite logic from what the hardware naturally provides. This lets you match your firmware expectations without rewiring.

2. Open-drain with Pull-up (o^)

shared_alarm_pin 2.11o^
shared_alarm_pin PC7o^

This creates a “wired-OR” configuration where multiple devices can signal on the same wire. Each device uses open-drain to pull the line low when active, and the pull-up resistor keeps it high when no device is signaling.

Why it’s useful: You can connect multiple safety sensors (like door switches, emergency stops, or temperature alarms) to a single pin. Any sensor triggering will pull the pin low.

3. Inverted Open-drain (!o)

output_pin 1.18!o
output_pin PB8!o

This inverts an open-drain output, which can be useful when controlling devices that expect active-high signals while using open-drain for level shifting.

Why it’s useful: When interfacing with 5V logic devices from your 3.3V Smoothieboard, you can use open-drain with a pull-up resistor to 5V on the other device. The inversion lets you maintain the expected logic levels.

4. No Pull with Invert (!-)

external_driver_pin 2.5!-
external_driver_pin PD12!-

Disables internal pull resistors and inverts the signal. This is useful when external hardware provides its own pull resistors and you need inverted logic.

Why it’s useful: Some external stepper drivers or relay boards have their own pull-up or pull-down resistors. Using - prevents conflicts between internal and external resistors, and ! adapts the logic level.

5. Pull-down with Invert (!v)

sensor_pin 1.29!v
sensor_pin PE6!v

Uses pull-down to keep the pin low by default, then inverts the reading. This means the firmware sees “high” when nothing is connected and “low” when the sensor activates and pulls the pin high.

Why it’s useful: Some active sensors output a positive voltage when triggered. Pull-down keeps noise low when disconnected, and the inversion can match your firmware’s expected logic.

Important Notes on Combining Modifiers

  • Order doesn’t matter: !o^, ^o! and o!^ all do the same thing
  • Conflicting modifiers: use just one of ^, v, - or, on V1, @. Don’t combine pull-up (^) and pull-down (v) on the same pin, or pull-up (^) with no-pull (-)
  • Logical combinations: think through what each modifier does and make sure they work together logically
  • Test your setup: when using multiple modifiers, always test that the pin behaves as expected before relying on it for critical functions like endstops or safety sensors. Check the input at rest and again with the switch operated before you rely on it for homing or probing.

Quick Reference: Common Combinations

Combination What it does Use case
!^ Inverts an input with an internal pull-up Endstops with reversed logic
o^ Selects open drain, with a pull-up on hardware that supports it Multiple sensors on one pin
!o Inverts an open-drain output Level shifting with inverted logic
!- Inverts an input with no internal pull External pull resistors with reversed logic
!v Inverts an input with an internal pull-down Active-high sensors with reversed logic

Summary:

  • Pull-up (^): default, best for switches and sensors (pin high by default, goes low when triggered)
  • Pull-down (v): opposite of pull-up (pin low by default, goes high when triggered)
  • Open-drain (o): for sharing pins between multiple devices or level shifting
  • Repeater (@): for long cables or maintaining state (rarely needed, V1 only)

Default Pin Assignments

This table shows the default pin assignments for common functions on V1. Use the pinout for your board to see which pins are where.

Function Pin Notes
X Step 2.0 Alpha stepper
X Dir 0.5 Alpha stepper
Y Step 2.1 Beta stepper
Y Dir 0.11 Beta stepper
Z Step 2.2 Gamma stepper
Z Dir 0.20 Gamma stepper
E0 Step 2.3 Delta stepper / Extruder
E0 Dir 0.22 Delta stepper / Extruder
Min X 1.24 X endstop
Min Y 1.26 Y endstop
Min Z 1.28 Z endstop
Max X 1.25 X max endstop
Max Y 1.27 Y max endstop
Max Z 1.29 Z max endstop
Hotend 2.7 PWM output
Bed 2.5 PWM output

The pins depend on the controller and board revision. For V2 Prime, start with the board guide and pin map. The V2 sample configs in the SmoothieV2 repository show working pin assignments.

Configuration Example

Add modifiers to the pins already used in your config. Here is a typical configuration showing stepper and endstop pin assignments, from the V1 Smoothieboard config.

# Stepper and endstop configuration
alpha_step_pin                       2.0
alpha_dir_pin                        0.5!
alpha_en_pin                         0.4
alpha_min_endstop                    1.24^
alpha_max_endstop                    1.25^

beta_step_pin                        2.1
beta_dir_pin                         0.11!
beta_en_pin                          0.10
beta_min_endstop                     1.26^
beta_max_endstop                     1.27^

Use the pins from your own config. This example changes the direction pin on an external driver and sets the pull-up on an X endstop. Set the other endstop options for your switch as well.

[actuator]
alpha.dir_pin = PG1!

[endstops]
minx.pin = PD0^
Tip: Use the example configuration file as a starting point, then customize the settings (like speeds, accelerations, and thermistor values) for your specific machine. This ensures all pin assignments are correct for your hardware.

Appendix: V2 default pins from the older wiki

This table and example come from the older wiki. They have not been checked against the current V2 hardware and the pin names may not match the V2 Prime pinout, so use the V2 Prime board guide and pin map and the SmoothieV2 sample configs for real assignments.

Function Pin Notes
X Step PF0 Alpha stepper
X Dir PF1 Alpha stepper
Y Step PF2 Beta stepper
Y Dir PF3 Beta stepper
Z Step PF4 Gamma stepper
Z Dir PF5 Gamma stepper
E0 Step PF6 Delta stepper / Extruder
E0 Dir PF7 Delta stepper / Extruder
Min X PG0 X endstop
Min Y PG1 Y endstop
Min Z PG2 Z endstop
Max X PG3 X max endstop
Max Y PG4 Y max endstop
Max Z PG5 Z max endstop
Hotend PE5 PWM output
Bed PE6 PWM output

The older wiki’s V2 example configuration (in the old flat format, which V2 does not use):

# Stepper and endstop configuration
alpha_step_pin                       PF0
alpha_dir_pin                        PF1!
alpha_en_pin                         PC0
alpha_min_endstop                    PG0^
alpha_max_endstop                    PG3^

beta_step_pin                        PF2
beta_dir_pin                         PF3!
beta_en_pin                          PC3
beta_min_endstop                     PG1^
beta_max_endstop                     PG4^
This is a wiki! If you'd like to improve this page, you can edit it on GitHub.