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
Diff: BSP/x_nucleo_ihm02a1_class.h
- Revision:
- 14:e614697ebf34
- Parent:
- 11:1aca63b2f034
- Child:
- 15:31785d1acd4b
--- a/BSP/x_nucleo_ihm02a1_class.h Tue Jan 19 16:07:00 2016 +0000
+++ b/BSP/x_nucleo_ihm02a1_class.h Tue Feb 09 16:01:30 2016 +0000
@@ -49,12 +49,12 @@
/* ACTION 1 ------------------------------------------------------------------*
* Include here platform specific header files. *
- *----------------------------------------------------------------------------*/
+ *----------------------------------------------------------------------------*/
#include "mbed.h"
#include "DevSPI.h"
/* ACTION 2 ------------------------------------------------------------------*
- * Include here expansion board specific header files. *
- *----------------------------------------------------------------------------*/
+ * Include here expansion board configuration's header files. *
+ *----------------------------------------------------------------------------*/
#include "x_nucleo_ihm02a1_config.h"
/* ACTION 3 ------------------------------------------------------------------*
* Include here expansion board's components' header files. *
@@ -86,7 +86,7 @@
* @param ssel pin name of the SSEL pin of the SPI device to be used for communication.
* @param spi SPI device to be used for communication.
*/
- X_NUCLEO_IHM02A1(L6470_InitTypeDef *init_0, L6470_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi);
+ X_NUCLEO_IHM02A1(L6470_Init_t *init_0, L6470_Init_t *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI *spi);
/**
* @brief Constructor.
@@ -100,7 +100,7 @@
* @param miso pin name of the MISO pin of the SPI device to be used for communication.
* @param sclk pin name of the SCLK pin of the SPI device to be used for communication.
*/
- X_NUCLEO_IHM02A1(L6470_InitTypeDef *init_0, L6470_InitTypeDef *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk);
+ X_NUCLEO_IHM02A1(L6470_Init_t *init_0, L6470_Init_t *init_1, PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, PinName mosi, PinName miso, PinName sclk);
/**
* @brief Destructor.
@@ -198,7 +198,7 @@
L6470 *components[L6470DAISYCHAINSIZE];
/* Components' initialization. */
- L6470_InitTypeDef *init_components[L6470DAISYCHAINSIZE];
+ L6470_Init_t *init_components[L6470DAISYCHAINSIZE];
/* Results of prepared actions. */
uint32_t results[L6470DAISYCHAINSIZE];
@@ -218,6 +218,6 @@
static uint8_t number_of_boards;
};
-#endif // __X_NUCLEO_IHM02A1_CLASS_H
+#endif /* __X_NUCLEO_IHM02A1_CLASS_H */
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

X-NUCLEO-IHM02A1 Two Axis Stepper Motor Driver