Library to handle the X_NUCLEO_IHM02A1 Motor Control Expansion Board based on the L6470 component.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_IHM02A1 ConcorsoFinal HelloWorld_IHM02A1_mbedOS HelloWorld_IHM02A1-Serialinterpreter ... more
Fork of X_NUCLEO_IHM02A1 by
Motor Control Library
Introduction
Library to handle the X-NUCLEO-IHM02A1 Motor Control Expansion Board based on the the L6470 component.
Daisy-Chain Configuration
The two L6470 components mounted on this board are connected in daisy-chain configuration. This board can be stacked up to four times so that the eight L6470 components will be connected two-by-two in daisy-chain configuration.
Concerning the SSEL pin of the SPI communication, each expansion board must be in one of the following configuration:
SB_23resistor connected only: SSEL on pinA2;SB_7resistor connected only: SSEL on pinD2;SB_8resistor connected only: SSEL on pinD10;SB_9resistor connected only: SSEL on pinD5.
Arduino Connector Compatibility Warning
X-NUCLEO-IHM02A1 is Arduino compatible with one exception: instead of using D13 pin to drive the SPI clock, it uses D3 pin, hence the default configuration for this library is with the SPI clock on D3 pin.
To be fully Arduino compatible the following patch is required:
- to remove the
SB34resistor; - to solder the
SB12resistor.
Alternatively, you can route the Nucleo board’s D13 pin directly to the expansion board’s D3 pin with a wire.
In case you patch your expansion board or route the pin, the SPI clock will be driven on D13 pin rather than on D3 pin, and you have also to initialize the sclk PinName variable with D13 rather than D3.
This patch is known to be required, for example, on the following boards: NUCLEO-F103RB, NUCLEO-F302RB, NUCLEO-F411RE, and NUCLEO-F429ZI.
If you use D13 pin for the SPI clock, please be aware that on STM32 Nucleo boards you may not drive the LED, otherwise you will get a conflict: the LED on STM32 Nucleo boards is connected to the D13 pin.
Example Applications
Revision 12:a942d51c488b, committed 2016-01-15
- Comitter:
- Davidroid
- Date:
- Fri Jan 15 17:05:43 2016 +0000
- Parent:
- 11:1aca63b2f034
- Child:
- 13:25a579b9b7c3
- Commit message:
- + Typos corrected.
Changed in this revision
--- a/Components/Interfaces/Component_class.h Thu Jan 14 10:00:31 2016 +0000 +++ b/Components/Interfaces/Component_class.h Fri Jan 15 17:05:43 2016 +0000 @@ -1,7 +1,7 @@ /** ****************************************************************************** * @file Component_class.h - * @author Davide Aliprandi, STMicrolectronics + * @author Davide Aliprandi, STMicroelectronics * @version V1.0.0 * @date April 13th, 2015 * @brief This file contains the abstract class describing the interface of a
--- a/Components/Interfaces/StepperMotor_class.h Thu Jan 14 10:00:31 2016 +0000 +++ b/Components/Interfaces/StepperMotor_class.h Fri Jan 15 17:05:43 2016 +0000 @@ -1,7 +1,7 @@ /** ****************************************************************************** * @file StepperMotor_class.h - * @author Davide Aliprandi, STMicrolectronics + * @author Davide Aliprandi, STMicroelectronics * @version V1.0.0 * @date November 12th, 2015 * @brief This file contains the abstract class describing the interface of a
--- a/Components/l6470/l6470_class.cpp Thu Jan 14 10:00:31 2016 +0000
+++ b/Components/l6470/l6470_class.cpp Fri Jan 15 17:05:43 2016 +0000
@@ -1443,10 +1443,9 @@
/**
* @brief Configures the L6470 registers.
- * @param StepperMotorDriverHandle_t* The pointer to the stepper motor driver handle structure.
- * @param MotorParameterData_t* The pointer to the related parameter data structure.
+ * @param init The pointer to the initialization structure.
*/
-DrvStatusTypeDef L6470::L6470_Config(L6470_InitTypeDef *MotorParameterData)
+DrvStatusTypeDef L6470::L6470_Config(void *init)
{
/* Disable the L6470. */
L6470_DISABLE();
@@ -1461,6 +1460,7 @@
GetStatus();
/* Prepare the 'Register' field of StepperMotorDriverHandle */
+ L6470_InitTypeDef *MotorParameterData = (L6470_InitTypeDef *) init;
StepperMotorRegister.ACC = L6470_Step_s2_2_Acc(MotorParameterData->acc);
StepperMotorRegister.DEC = L6470_Step_s2_2_Dec(MotorParameterData->dec);
StepperMotorRegister.MAX_SPEED = L6470_Step_s_2_MaxSpeed(MotorParameterData->maxspeed);
--- a/Components/l6470/l6470_class.h Thu Jan 14 10:00:31 2016 +0000 +++ b/Components/l6470/l6470_class.h Fri Jan 15 17:05:43 2016 +0000 @@ -1,7 +1,7 @@ /** ****************************************************************************** * @file l6470_class.h - * @author Davide Aliprandi, STMicrolectronics + * @author Davide Aliprandi, STMicroelectronics * @version V1.0.0 * @date November 12th, 2015 * @brief This file contains the class of an L6470 Motor Control component.

X-NUCLEO-IHM02A1 Two Axis Stepper Motor Driver