Create Your First Motor Control Application Using MPLAB® Harmony v3: Step 6

Last modified by Microchip on 2023/11/15 12:42

Hardware Setup

This section describes how to configure the supported hardware.

Mount the ATSAME54 Motor Control Plug-in Module on the U9 header.

Hardware setup

Back to top


Place the External Op-amp Configuration Matrix board at J14.

Placing the External Op-amp Configuration Matrix board at J14png

Back to top


Connect the motor phases and hall sensor interfaces. Hall and phase connections for Short Hurst motor are as follows.

Hall Connector Chart

Phase Connections Chart

Back to top


Final hardware setup is shown in the accompanying image.

Final Hardware setup

Back to top


Build, Program, and Observe the Outputs

Go to File > Project Properties and verify the correct debugger is selected under Hardware Tools. Check that XC32 (v4.30) is selected as the Compiler Toolchain for XC32.

choose 32

Back to top


Clean and build your application by clicking on the Clean and Build button.

clean and build button

Back to top


Program your application to the device, by clicking on the Make and Program button.

Make and Program button

The project should build and program successfully.

Back to top


Results

  1. Press the S2 switch to start the motor.
  2. Press the S3 switch to toggle the motor direction.
  3. Vary the potentiometer to change the speed of the motor.
  4. Press the S2 switch again to stop the motor.

Back to top

Conclusions

This training module described how to configure and use all the fundamental components needed to build a real-time motor control application on a SAM D5x/E5x microcontroller with the MPLAB® Harmony v3 Framework. As a next step, you may customize this application and reconfigure some of the components used in this training module. You could also add new components (PLIBs, etc.) to develop your end application.

Back to top