dcmotor24 2.1.0.0
|
DC Motor 24 Click is a compact add-on board with a brushed DC motor driver. This board features the L9958, an SPI-controlled H-bridge from STMicroelectronics. The L9958 is rated for an operating voltage range from 4V to 28V, with direct PWM motor control and current regulation threshold set by the SPI interface from 2.5A to 8.6A. It also has complete diagnostic and protection capabilities supporting the robust and reliable operation.
We provide a library for the DC Motor 24 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
This library contains API for DC Motor 24 Click driver.
dcmotor24_cfg_setup
Config Object Initialization function. dcmotor24_init
Initialization function. dcmotor24_default_cfg
Click Default Configuration function. dcmotor24_read_diag
This function reads a diagnostics word by using SPI serial interface. dcmotor24_switch_direction
This function switches the direction by toggling the DIR pin state. dcmotor24_set_duty_cycle
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ). This example demonstrates the use of the DC Motor 24 Click board by driving the motor in both directions at different speeds.
The demo application is composed of two sections :
Initializes the driver and performs the click default configuration.
Controls the motor speed by changing the PWM duty cycle every 500ms.
The duty cycle ranges from 0% to 100%. At the minimal speed, the motor switches direction. It also reads and parses the diagnostics word register. Each step will be logged on the USB UART where you can track the program flow.
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
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. UART terminal is available in all MikroElektronika compilers.