How does it work?
This Click board™ is optimized for driving brushless motors in portable applications. Therefore, the STSPIN233 from STMicroelectronics contains three independent H-Bridges, and each of them controls one phase of the brushless motor. These integrated H-Bridges are very efficient – with ON resistance of approximately 400mΩ (HS+LS) across each bridge. These features make STSPIN233 click perfectly suited for rapid development of various battery-powered stepper motor applications, including toys, printers, mechatronics, drones, robotics-related applications, etc.
Besides the brushless driver IC, this Click board™ also has STM32F031K6T6 MCU onboard, which serves as a “brain” of the STSPIN233 Click. It comes with a preloaded firmware, which is programmed to take control of the motor driver. It reads the current motor status and signals from an optional rotary encoder, calculates values of desired and real motor status in real time and makes necessary corrections to the motor driver. The motor can be controlled by using these pins: RST, INT, and UART pins – RX and TX. That way, very reliable brushless motor driver is achieved.
The RST pin of the STSPIN233 Click is used to set both bridge outputs in HIGH-Z mod, disconnecting the power supply from the H-Bridges. This pin allows lower average power consumption as no current can flow from the power supply to the motor. This pin is routed to the RST pin of the mikroBUS™.
The INT pin has a double purpose: when set to a high logic level, it acts as a chip enable, allowing the device to operate. In the case of a fault condition on the IC, it will be asserted to a LOW logic level, acting as an interrupt pin. After a timeout period defined by the external capacitor and resistor values, a restart attempt will be made. This pin is routed to both INT pin of the mikroBUS™, allowing the host MCU to use both functions. The mentioned pin is labeled as FLT on the Click board™, respectively.
The motor power supply can be connected to the input terminal labeled as VIN and should be within the range of 1.8V to 10V. Brushless motor coils can be connected to the terminals labeled as U, V, and W. The Click board™ requires an external power supply for the motor in order to work. However, it also requires 3.3V from the mikroBUS™ rail.
Specifications
Type
Brushless
Applications
STSPIN233 click is perfectly suited for rapid development of various battery-powered stepper motor applications, including toys, printers, mechatronics, drones, robotics-related applications, etc.
On-board modules
STSPIN233, a low voltage DC brushed motor driver by STMicroelectronics.
Key Features
The main IC features a set of protection features, allowing reliable performance. It is optimized for a low-power and battery-operated applications, featuring very low ON resistance, and lowest standby current on the market.
Interface
GPIO,UART
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V,5V
Pinout diagram
This table shows how the pinout on STSPIN233 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
STSPIN233 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Input voltage | 1.8 | – | 10 | V |
Output current | 0 | – | 1.3 | A |
Software Support
We provide a library for the STSPIN233 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
Library contains functions for STSPIN233 click initialization and basic control. User has at it’s disposal this library, which contains functions for waking up the module and sending commands to it. Click board can also be initialized and used with UART terminal.
Key functions:
void stspin233_send_single_cmd ( uint8_t *tx_buf )
– Send single commandvoid stspin233_send_double_cmd ( uint8_t *cmd_buf, uint8_t *arg_buf )
– Send double commandvoid stspin233_wakeup( )
– Module wake-up (procedure)
Examples description
The application is composed of three sections :
- System Initialization – Initializes UART module and all necessary GPIO pins.
- Application Initialization – Initializes driver init, starts basic engine setups and initializes a uart interrupt routine for logs data.
- Application Task – Waits for valid user input and executes functions based on set of valid commands.
- Commands : ‘S or s’ – Start Motor ‘B or b’ – Brake/Stop motor ‘D or d’ – Change of motor direction ‘?’ – FW motor status
void application_task ( ) { uint8_t console_drdy; char console_rx_data; console_drdy = UART_Rdy_Ptr( ); if ( console_drdy != 0 ) { console_rx_data = UART_Rd_Ptr( ); app_cmd_parser( console_rx_data ); } }
Additional Functions :
- app_cmd_parser ( ) – Console command parser
- set_interrupt ( ) – Interrupt init and enable
- Note – For all other commands that you can use to control your engine, see the firmware documentation. We used an 8 pole motor for the test.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.