Beginner
10 min

Control inductive and resistive loads in industrial and other high-demand environments with TPD2015FN and STM32F031K6

High side switch (8-channels) for motors, solenoids, lamp drives

IPD Click - 2015 with Nucleo 32 with STM32F031K6 MCU

Published Oct 01, 2024

Click board™

IPD Click - 2015

Dev Board

Nucleo 32 with STM32F031K6 MCU

Compiler

NECTO Studio

MCU

STM32F031K6

Enrich industrial automation and applications requiring the control of resistive and inductive loads up to 50mH with a current capacity of 0.5A per channel

A

A

Hardware Overview

How does it work?

IPD Click - 2015 is based on the TPD2015FN, an 8-channel high-side switch featuring MOSFET outputs from Toshiba Semiconductor, designed to be directly driven by CMOS and TTL logic circuitry. It's ideally suited for driving inductive and resistive loads, such as industrial programmable logic controllers for industrial use, motors, relays, lamps in factory automation equipment, and more. A key advantage of the TPD2015FN is its built-in overcurrent and overtemperature protection, enhancing system stability by safeguarding against excessive heat and current. Equipped with the capability to handle back electromotive force from inductive loads without surpassing the component's voltage tolerance, the TPD2015FN is optimized for loads up to 50mH with a current capacity of 0.5A per channel, supported by an external power supply ranging from 8-24V. The channels can be

operated in parallel to increase the current capability of the outputs. As mentioned, this Click board™ incorporates comprehensive protection mechanisms, including overtemperature protection that deactivates all outputs (OUT1-OUT8) if the temperature exceeds 175°C and overcurrent protection that limits voltage and current during load shorts, ensuring the device and its connected peripheral safety. Designed for straightforward integration with CMOS and TTL systems, the IPD Click features input control terminals for each output channel, allowing independent channel control. Inputs IN1 to IN4 interface directly via the mikroBUS™ socket, with additional inputs IN5 to IN8 accessible through an unpopulated header. Each input control pin of the TPD2015FN is equipped with a built-in 300kΩ pull-down resistor to maintain a LOW logic state in an open state. This

Click board™ comes with optional inductive load decoupling diodes unpopulated by default, the CRS20140A from Toshiba Semiconductor, allowing users to add them in the case of higher inductive loads. Also, it is equipped with jumpers for the diode configuration of the used load switch and its power management. These jumpers are pre-configured, enabling immediate use without the need for any adjustments. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.

IPD Click - 2015 hardware overview image

Features overview

Development board

Nucleo 32 with STM32F031K6 MCU board provides an affordable and flexible platform for experimenting with STM32 microcontrollers in 32-pin packages. Featuring Arduino™ Nano connectivity, it allows easy expansion with specialized shields, while being mbed-enabled for seamless integration with online resources. The

board includes an on-board ST-LINK/V2-1 debugger/programmer, supporting USB reenumeration with three interfaces: Virtual Com port, mass storage, and debug port. It offers a flexible power supply through either USB VBUS or an external source. Additionally, it includes three LEDs (LD1 for USB communication, LD2 for power,

and LD3 as a user LED) and a reset push button. The STM32 Nucleo-32 board is supported by various Integrated Development Environments (IDEs) such as IAR™, Keil®, and GCC-based IDEs like AC6 SW4STM32, making it a versatile tool for developers.

Nucleo 32 with STM32F031K6 MCU double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

ARM Cortex-M0

MCU Memory (KB)

32

Silicon Vendor

STMicroelectronics

Pin count

32

RAM (Bytes)

4096

You complete me!

Accessories

Click Shield for Nucleo-32 is the perfect way to expand your development board's functionalities with STM32 Nucleo-32 pinout. The Click Shield for Nucleo-32 provides two mikroBUS™ sockets to add any functionality from our ever-growing range of Click boards™. We are fully stocked with everything, from sensors and WiFi transceivers to motor control and audio amplifiers. The Click Shield for Nucleo-32 is compatible with the STM32 Nucleo-32 board, providing an affordable and flexible way for users to try out new ideas and quickly create prototypes with any STM32 microcontrollers, choosing from the various combinations of performance, power consumption, and features. The STM32 Nucleo-32 boards do not require any separate probe as they integrate the ST-LINK/V2-1 debugger/programmer and come with the STM32 comprehensive software HAL library and various packaged software examples. This development platform provides users with an effortless and common way to combine the STM32 Nucleo-32 footprint compatible board with their favorite Click boards™ in their upcoming projects.

Click Shield for Nucleo-32 accessories 1 image

Used MCU Pins

mikroBUS™ mapper

Load 1 Control
PA0
AN
Load 2 Control
PA11
RST
ID COMM
PA4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Load 3 Control
PA8
PWM
Load 4 Control
PA12
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

Take a closer look

Schematic

IPD Click - 2015 Schematic schematic

Step by step

Project assembly

Click Shield for Nucleo-144 front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Nucleo 32 with STM32F031K6 MCU as your development board.

Click Shield for Nucleo-144 front image hardware assembly
Nucleo 144 with STM32L4A6ZG MCU front image hardware assembly
Stepper 22 Click front image hardware assembly
Prog-cut hardware assembly
Stepper 22 Click complete accessories setup image hardware assembly
Nucleo-32 with STM32 MCU Access MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
STM32 M4 Clicker HA MCU/Select Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output via Debug Mode

1. Once the code example is loaded, pressing the "DEBUG" button initiates the build process, programs it on the created setup, and enters Debug mode.

2. After the programming is completed, a header with buttons for various actions within the IDE becomes visible. Clicking the green "PLAY" button starts reading the results achieved with the Click board™. The achieved results are displayed in the Application Output tab.

DEBUG_Application_Output

Software Support

Library Description

This library contains API for IPD Click - 2015 driver.

Key functions:

  • ipd2015_all_pins_set - IPD 2015 pin setting function

  • ipd2015_set_out_level - IPD 2015 set output level function

  • ipd2015_get_out_state - IPD 2015 get output level function

Open Source

Code example

This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.

/*!
 * @file main.c
 * @brief IPD 2015 Click Example.
 *
 * # Description
 * This example demonstrates the use of IPD 2015 click board by toggling the output state.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and logger.
 *
 * ## Application Task
 * Switches on all output pins state for 2 seconds, then switches them off, and turns them on one by one.
 *
 * @author Stefan Ilic
 *
 */

#include "board.h"
#include "log.h"
#include "ipd2015.h"

static ipd2015_t ipd2015;   /**< IPD 2015 Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    ipd2015_cfg_t ipd2015_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    ipd2015_cfg_setup( &ipd2015_cfg );
    IPD2015_MAP_MIKROBUS( ipd2015_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == ipd2015_init( &ipd2015, &ipd2015_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    log_printf( &logger, " Turning OUT 1 to OUT 4 HIGH \r\n" );
    ipd2015_all_pins_set( &ipd2015 );
    Delay_ms( 2000 );

    log_printf( &logger, " Turning OUT 1 to OUT 4 LOW \r\n" );
    ipd2015_all_pins_clear( &ipd2015 );
    Delay_ms( 2000 );

    log_printf( &logger, " Turning OUT 1 to OUT 4 one by one \r\n" );
    uint8_t out_sel = IPD2015_OUT1_PIN_MASK;
    do
    {
        ipd2015_set_out_level( &ipd2015, out_sel, IPD2015_PIN_STATE_HIGH );
        Delay_ms( 2000 );
        ipd2015_set_out_level( &ipd2015, out_sel, IPD2015_PIN_STATE_LOW );
        out_sel <<=  1;
    }
    while ( out_sel <= IPD2015_OUT4_PIN_MASK );
    
}

void main ( void ) 
{
    application_init( );

    for ( ; ; ) 
    {
        application_task( );
    }
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.