CNC Shield with Nucleo f767zi

Hello, How do we run the bipolar stepper motor regulated with CNC shield, A4988 driver and using Nucleo f767zi as MCU. Previously we used stepper motor drivers controlled by stepper.h library for stepper motors without CNCshield where 4 pins(step+, step-,dir+, dir-) will be coming out from stepper motor driver, but when we use CNC shield there are only 2 wires (step, dir)will be coming out. Is there is any library where we can control stepper motors with CNC shield connected to Nucleo f767zi?



A search for A4988 in the old (archived) forum at

shows several hits, like:

For wiring have a look at the A4988 data sheet.
For example at

  • The NUCLEO-F767ZI tells the A4988 to make a step by generating a pulse (0->1->0) on the step line.

  • At the same time it specifies the step’s direction over the dir line. For example, 0 could mean clockwise and 1 counter clockwise. But that depends on how the motor coils are connected to the A4988.

  • The A4988 drives the stepper over four lines connected to the motor coils.
    For example:

A4988    |  Stepper motor
AOUT1A   |  coil 1, pin A
AOUT1B   |  coil 1, pin B
AOUT2A   |  coil 2, pin A
AOUT2B   |  coil 2, pin B
  • The motor speed depends on how frequently the NUCLEO-F767ZI generates the step pulses.

Best regards, Zoltan