The wiki page for the RAMBo board mentions:

Step and Direction pins are on their own ports for synchronous movement capability

What does this mean, and how does it affect printing? Do I need special firmware to take advantage of this?


1 Answer 1


A "port" for the AVR microcontroller is a set of eight IO pins that are controlled together at a hardware level. The underlying machine code can write an entire byte to set the status of all 8 pins at once. So in principle, all the step pins on the RAMBO board can be triggered exactly simultaneously.

The Arduino IDE hides this behavior from firmwares by abstracting the port's byte handling as a function call for each individual pin. That means programmers only have to know the Arduino PIN number, not which port and position on the processor is being used. And then the modern firmwares typically used by RAMBO do a further layer of abstraction to make it easy for the same firmware to be used by different boards, by changing pin assigned names in a config file (usually pins.h) and not assuming any specific port selection was made during board design.

There's no guarantee for open-source firmware that a particular pin selection was made in hardware. Lots of 3D printer controller boards even have pretty dumb pin assignments, like using hardware-PWM-capable pins for stepper signals rather than PWM'd heaters. Marlin and Repetier have chosen flexibility over performance optimization in this regard. They pretty much let the board designer use any pin for anything. When they have to do stuff like run heater PWM control or fire a bunch of step pulses as fast as possible, they emulate that in software rather than taking advantage of specific hardware that isn't always available.

In this specific case, there may not actually be all that much performance gain/loss. Writing to an output pin is pretty fast. The amount of time difference between firing a few step pulses in sync or firing them sequentially is on the order of a few microseconds. That won't make any difference to the motion fidelity of the printer's physical drivetrains. Somebody involved in the RAMBO design just thought it could be useful, and put a reference to it on the Wiki page (in the very first upload!) and it's never been clarified or removed from the Wiki page in the years since.

  • $\begingroup$ Right, so since Marlin writes the pins sequentially, it makes no difference at all? Or do the ports have limited "refresh rate" so-to-speak, perhaps making it more likely that writes in quick succession appear at the same time? I think the last bit about "a few milliseconds" is inaccurate since step rates tend to be in the 10kHz range. $\endgroup$ Apr 29, 2016 at 6:29
  • $\begingroup$ Oh yeah, I meant microseconds, not milliseconds. I'll fix that. $\endgroup$ Apr 29, 2016 at 17:54
  • $\begingroup$ In order for the pins to write simultaneously from a series of sequential commands in the human-readable code, the compiler would have to be optimizing the pin write commands together. I doubt it does that, since Bresenham's has to decide whether to pulse each stepper in a particular interrupt tick... that kind of conditional is not really something susceptible to compile time optimization. Hypothetically, I suppose it's possible, but I doubt the Arduino IDE would be able to do it. $\endgroup$ Apr 29, 2016 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .