Marlin Firmware

Is there any place on video that describes the working theory of Marlin code structure.

I would like to learn how Marlin controls 4 steppers, 2 heaters, read two thermistors, a rotary encoder, and update grahical display on an arduino mega attached to a ramps 1.4 shield… seemingly instantaneously.

NO clues fr youtube, google, nor here.

Marlin and its equivalents are very complex programs carefully optimised to give great performance. Understanding Marlin will not be trivial.

You will probably get better guidance on the RepRap Forum where they specialise in 3D printing.


Its mainly very simple, everything is event driven, normal for a micro-controller. Timers and external interrupts schedule high-priority actions, the rest will happen in the background using whatever processor cycles are spare.

The GCODE interpreter code wll be converting GCODE to a list of low-level instructions to the stepper-driver and
queuing them, the stepper driver is going to be interrupt driven and pull instructions from the queue as it needs them - all GCODE interpreters are like this I suspect, its the obvious way to go.

The complicated bit is figuring out when to accelerate and decelerate and corner-speeds and things like arc

“Seemingly instantaneously” means in under a few million instructions, not so hard!