Test application for the STMicroelectronics X-NUCLEO-IHM01A1 Stepper Motor Control Expansion Board.

Dependencies:   X_NUCLEO_IHM01A1

Fork of MotorControl_IHM01A1 by ST

Motor Control with the X-NUCLEO-IHM01A1 Expansion Board

This application provides a more complex example of usage of the X-NUCLEO-IHM01A1 Stepper Motor Control Expansion Board.
It shows how to use one stepper motor connected to the board, with an example of ISR and error handler, as well as an almost complete coverage of the available APIs, e.g.:

  • moving the rotor to a specific position;
  • moving the rotor for a certain amount of time;
  • setting the speed value;
  • setting the direction of rotation;
  • changing the stepper motor mode;
  • soft/hard stopping the rotor;
  • powering off the power bridge.

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Wed Jan 13 15:22:56 2016 +0000
Parent:
13:f4cc7104a1c5
Child:
15:4a1684b7252b
Commit message:
+ Updated with the new version of the library.

Changed in this revision

X_NUCLEO_IHM01A1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/X_NUCLEO_IHM01A1.lib	Mon Jan 04 16:08:52 2016 +0000
+++ b/X_NUCLEO_IHM01A1.lib	Wed Jan 13 15:22:56 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST/code/X_NUCLEO_IHM01A1/#35b9ca8c4bd6
+https://developer.mbed.org/teams/ST/code/X_NUCLEO_IHM01A1/#5f0b00a1e38d
--- a/main.cpp	Mon Jan 04 16:08:52 2016 +0000
+++ b/main.cpp	Wed Jan 13 15:22:56 2016 +0000
@@ -71,7 +71,7 @@
 void FlagIRQHandler(void)
 {
     /* Set ISR flag. */
-    motor->isrFlag = TRUE;
+    motor->isr_flag = TRUE;
 
     /* Get the value of the status register. */
     unsigned int status = motor->GetStatus();
@@ -87,10 +87,10 @@
     { /* Backward direction is set. Action to be customized. */ }
     
     /* Check NOTPERF_CMD flag: if set, the command received by SPI can't be performed. */
-    /* This often occures when a command is sent to the L6474 while it is in HIZ state. */
+    /* This often occures when a command is sent to the L6474 while it is not in HiZ state. */
     if ((status & L6474_STATUS_NOTPERF_CMD) == L6474_STATUS_NOTPERF_CMD)
     { /* Command received by SPI can't be performed. Action to be customized. */ }
-    
+     
     /* Check WRONG_CMD flag: if set, the command does not exist. */
     if ((status & L6474_STATUS_WRONG_CMD) == L6474_STATUS_WRONG_CMD)
     { /* The command received by SPI does not exist. Action to be customized. */ }
@@ -112,7 +112,7 @@
     { /* Overcurrent detection. Action to be customized. */ }
 
     /* Reset ISR flag. */
-    motor->isrFlag = FALSE;
+    motor->isr_flag = FALSE;
 }
 
 /**