7/30/2019
Basys MX3 Reference Manual [Reference.Digilentinc]
https://reference.digilentinc.com/reference/microprocessor/basys-mx3/reference-manual?_ga=2.68739409.1349070004.1564406803-1961480359.…
33/52
Connector
Label
Motor Driver
pin
Description
A1
AOUT1
IN/IN mode: Signal 1 of the stepper motor
PH/EN mode: Signal 1 of the DC motor A
A2
AOUT2
IN/IN mode: Signal 2 of the stepper motor
PH/EN mode: Signal 2 of the DC motor A
B1
BOUT1
IN/IN mode: Signal 3 of the stepper motor
PH/EN mode: Signal 1 of the DC motor B
B2
AOUT2
IN/IN mode: Signal 4 of the stepper motor
PH/EN mode: Signal 2 of the DC motor B
The control of Motor module is implemented in the MOT library of the Basys MX3 library pack. Features of the implementation:
Mode selection is implemented by setting the digital output MODE pin.
Separate functionalities are implemented, corresponding to the two modes: IN/IN and PH/EN.
In IN/IN mode, the 4 control pins AIN1, AIN2, BIN1, BIN2 are used as digital outputs, in this manner:
They are initialized in a (1, 1, 0, 0) configuration, considered an unsigned hexadecimal value 0x0C.
To perform stepper motor steps, the configuration value is rotated left or right (according to the motor’s direction) with the
desired number of steps.
In PH/EN mode, the AIN1 and BIN1 are used as outputs, while the AIN2 and BIN2 are mapped to OC2 and OC3 modules, which
are configured to generate PWM signals. The control of the 2 DC motors is done like this:
The direction is set to digital output AIN1 (DC motor A) or BIN1 (DC motor B)
The speed of the motor is implemented by loading the OC2RS (DC motor A) or OC3RS (DC motor B) registers with the
desired values
The Basys MX3 provides two 3-pin servo headers, labeled SERVO 0 and SERVO 1.
Servo motors are designed to move to a precise desired position and then stop, and are composed of a control board, motor, sense
potentiometer, and gears that connect the motor and output shaft. A digital signal is sent to the control board which then drives the motor
until the sense potentiometer verifies that the output shaft is in the correct position.
14.2. Functionality
15. Servo Headers