How does it work?
This click board™ is equipped with two integrated circuits. The step motor driver IC is the DRV8847PWPR, a dual full-bridge motor driver from Texas Instruments. This IC internal structure is somewhat symmetrical. It features two MOSFET H-bridges used to drive two coils of a bipolar step motor in both directions. The DRV8847PWPR uses a wide input voltage range – from 2.7V to 18V. This is the voltage used to energize the motor coils. A jumper (JP4) is used to select whether to use external power supply or to obtain the power supply from the mikroBUS™ +3.3V or +5V rail. The DRV8847PWPR has two PHASE inputs which are used to control the direction of current flow through H-bridges and thus, the motor coils. It also allows controlling step motor in both full step and half step modes, by toggling states on MS1 and MS1 pins.
The bipolar step motor coils can be connected to the onboard screw terminals. There are two terminals, used to connect each of the step motor coils. The third connector is used to connect an external voltage, ranging from 2.7V to 18V, depending on the used motor voltage requirements. It should be noted that without a valid external voltage connected to this terminal, the motor will not work. Also, it should be noted that 20V is an absolute maximum voltage allowed as per datasheet, thus the overtemperature protection might be activated when driving heavier loads. The recommended maximum voltage should not exceed 18V, as stated on the silkscreen layer of the PCB.
All of the DRV8847PWPR control lines are routed to the second IC on Stepper 14 board, which is the PCA9538A, a well-known 8bit I/O expander with a serial interface, used on many of the MikroElektronika’s designs for its simplicity and reliability. It allows the control lines of the DRV8847PWPR IC to be driven via the I2C and few pins it uses – reducing the required pin count of the Stepper 14 click. This also allows for sending compact I2C messages, instead of toggling several pins at once – which can introduce problems with timing sometimes, especially when those pins belong to different MCU ports. By changing states of the six control pins, it is possible to drive the step motor in full step mode as well as the half step mode. However, provided MikroElektronika libraries contain simple and intuitive functions to fully control the bipolar step motor, connected to Stepper 14 click. Their usage is demonstrated in the included example application, which can be used as a reference for a custom design.
The motor power supply can be connected to the input terminal labeled as VIN and should be within the range of 2.7V to 18V. Stepper motor coils can be connected to the terminals labeled as A1, B2, B1, and A2. The Click board™ supports an optional external power supply for the motor in order to work.
However, this Click board™ can be supplied and interfaced with both 3.3V and 5V without the need for any external components. The onboard SMD jumper labeled as VCC SEL allows voltage selection for interfacing with both 3.3V and 5V microcontrollers.
Specifications
Type
Stepper
Applications
Refrigerator damper and ice maker, Washers, dryers and dishwashers, Electronic point-of-sale (ePOS) printers , Stage lighting equipment, Miniature circuit breakers and smart meters etc.
On-board modules
DRV8847PWPR Dual Full-Bridge 18V, 1A, Stepper Motor Driver, from Texas Instruments; PCA9538A 8bit I/O Expander with Serial Interface, from NXP
Key Features
Dual H-bridge motor driver, Single or dual brushed DC motors, One bipolar stepper motor, Solenoid loads, Multiple control interface options.
Interface
GPIO,I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Stepper 14 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 |
JP1 | VCC SEL | Left | Power Supply Voltage Selection: Left position 3V3, right position 5V |
JP2 | ADDR SEL | Left | Slave address selection: Left position 0, right position 1. |
JP3 | ADDR SEL | Left | Slave address selection: Left position 0, right position 1. |
JP4 | VM SEL | Left | Power select jumper for motor power supply: left position – On-board supply, right position – External supply. |
Stepper 14 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Input Voltage | 2.7 | – | 18 | V |
Output current | – | – | 1 | A |
Software Support
We provide a library for the Stepper14 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
The library covers all the necessary functions that enables the usage of the Stepper 14 Click board. It initializes and defines the I2C driver and drivers that allow full control of the device to the user. User can use the device to control forward and reverse motion, apply brake and coast functions for brushless dc motors, and forward and reverse motion in full step and half step for stepper motors.
Key functions:
void stepper14_step_motor ( uint8_t interface, uint8_t direction, uint32_t steps_no );
– Function is used to drive two or four wire stepper motor in user defined direction, one step at a time.void stepper14_set_half_step ( uint8_t hl_step );
– Function is used to set specific half step.void stepper14_control_mode_set ( uint8_t mode );
– Function is used to set mode of operation.
Examples description
The application is composed of three sections :
- System Initialization – Initializes I2C module, LOG and GPIO structures, sets INT pin as input and RST and CS pins as output.
- Application Initialization – Initalizes I2C driver, applies setup for 4-pin interface and writes an initial log.
- Application Task – (code snippet) Demonstrates use of Stepper 14 click board by driving NEMA 17 stepper motor one turn forward and then one turn backward.
void application_task ( ) { mikrobus_logWrite( " Stepper motor makes one turn forward ", _LOG_LINE ); stepper14_step_motor( STEPPER14_4_PIN_INTERFACE, STEPPER14_DIR_CW, 200 ); Delay_ms( 1000 ); mikrobus_logWrite( " Stepper motor makes one turn backward ", _LOG_LINE ); stepper14_step_motor( STEPPER14_4_PIN_INTERFACE, STEPPER14_DIR_CCW, 200 ); Delay_ms( 1000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
- 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.