Intermediate
30 min

Reduce voltage to a desirable level with ST1PS03 and PIC32MZ2048EFH100

Small in size, big in efficiency

Step Down 3 Click with Flip&Click PIC32MZ

Published Apr 06, 2023

Click board™

Step Down 3 Click

Dev Board

Flip&Click PIC32MZ

Compiler

NECTO Studio

MCU

PIC32MZ2048EFH100

Regulate the output voltage to a precise level and provide a stable power supply for various applications

A

A

Hardware Overview

How does it work?

Step Down 3 Click is based on the ST1PS03, an ultra-low quiescent new generation buck converter from STMicroelectronics. The ST1PS03 targets a small quiescent current consumption and guarantees high-efficiency operation even down to a few microampere loads. It can provide up to 400mA output current with an output voltage from 1.6V to 3.3V on the VCC-OUT terminal, selectable using three digital control pins routed to the INT, PWM, and AN pins of the mikroBUS™ socket, and an input voltage ranging from 1.8V to 5.5V appliable on VCC-IN terminal. The ST1PS03 is based on a hysteretic comparator that senses the coil ripple current, held constant in all operation modes. The ST1PS03 changes the switching frequency depending on the input supply voltage to maintain a continuous ripple current on the selected coil. It seamlessly transitions between PFM (pulse frequency

modulation) and PWM (pulse width modulation) mode with low ripple and good load transient response. During PWM mode (heavy load), the device operates in continuous conduction up to 400mA and a switching frequency of 2MHz maximum. The device enters 100% duty cycle operation if the input voltage comes close to the selected output voltage. The regulator is turned OFF during this mode, and the output pin is directly connected to the input pin through the internal high-side MOSFET. Once the input voltage exceeds the 100% duty cycle, the device restarts to switch and regulates the output voltage again. This Click board™ also has a Power Good comparator which monitors the selected output voltage and provides information on the appropriate PGOOD terminal. Step Down 3 Click communicates with MCU using several GPIO pins. The AUX pin routed to the CS pin of the mikroBUS™

socket controls the auxiliary output terminal labeled as VCC-OUT-A. It provides the same regulated voltage level as VCC-IN-a input voltage, with less drop on the load switch circuitry when the AUX pin and EN pin, routed to the RST pin of the mikroBUS™ socket, are tied high. The VCC-OUT-A terminal allows connecting/disconnecting the other system load to the output of the ST1PS03. This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.

step-down-3-click-hardware-overview

Features overview

Development board

Flip&Click PIC32MZ is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit PIC32MZ microcontroller, the PIC32MZ2048EFH100 from Microchip, four mikroBUS™ sockets for Click board™ connectivity, two USB connectors, LED indicators, buttons, debugger/programmer connectors, and two headers compatible with Arduino-UNO pinout. Thanks to innovative manufacturing technology,

it allows you to build gadgets with unique functionalities and features quickly. Each part of the Flip&Click PIC32MZ development kit contains the components necessary for the most efficient operation of the same board. In addition, there is the possibility of choosing the Flip&Click PIC32MZ programming method, using the chipKIT bootloader (Arduino-style development environment) or our USB HID bootloader using mikroC, mikroBasic, and mikroPascal for PIC32. This kit includes a clean and regulated power supply block through the USB Type-C (USB-C) connector. All communication

methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, user-configurable buttons, and LED indicators. Flip&Click PIC32MZ development kit allows you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

Flip&Click PIC32MZ double image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC32

MCU Memory (KB)

2048

Silicon Vendor

Microchip

Pin count

100

RAM (Bytes)

524288

Used MCU Pins

mikroBUS™ mapper

Output Voltage Selection Pin 2
RB11
AN
Device Enable
RE2
RST
Auxiliary
RA0
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Output Voltage Selection Pin 1
RC14
PWM
Output Voltage Selection Pin 0
RD9
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

Step Down 3 Click Schematic schematic

Step by step

Project assembly

Flip&Click PIC32MZ front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Flip&Click PIC32MZ as your development board.

Flip&Click PIC32MZ front image hardware assembly
GNSS2 Click front image hardware assembly
Prog-cut hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
Flip&Click PIC32MZ MB1 Access - 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
Flip&Click PIC32MZ MCU 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

1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support

Library Description

This library contains API for Step Down 3 Click driver.

Key functions:

  • stepdown3_enable_device This function enables the auxiliary output (VOUT_AUX) by setting the AUX pin to HIGH logic state.

  • stepdown3_enable_aux_output This function disables the auxiliary output (VOUT_AUX) by setting the AUX pin to LOW logic state.

  • stepdown3_set_output_voltage This function sets the output voltage by setting the D2, D1, and D0 pins to a desired state.

Open Source

Code example

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.

/*!
 * @file main.c
 * @brief Step Down 3 Click Example.
 *
 * # Description
 * This example demonstrates the use of Step Down 3 click board by
 * iterating through the entire output voltage range.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and logger, then enables the click board and disables
 * the auxiliary output.
 *
 * ## Application Task
 * Changes the output voltage every 3 seconds and displays the set voltage output value
 * on the USB UART.
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "stepdown3.h"

static stepdown3_t stepdown3;   /**< Step Down 3 Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    stepdown3_cfg_t stepdown3_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.
    stepdown3_cfg_setup( &stepdown3_cfg );
    STEPDOWN3_MAP_MIKROBUS( stepdown3_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == stepdown3_init( &stepdown3, &stepdown3_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    stepdown3_enable_device ( &stepdown3 );
    stepdown3_disable_aux_output ( &stepdown3 );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    static uint8_t vout = STEPDOWN3_OUT_VOLTAGE_1V6;
    stepdown3_set_output_voltage ( &stepdown3, vout );
    switch ( vout )
    {
        case STEPDOWN3_OUT_VOLTAGE_1V6:
        {
            log_printf( &logger, " Output voltage: 1.6 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_1V8:
        {
            log_printf( &logger, " Output voltage: 1.8 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V1:
        {
            log_printf( &logger, " Output voltage: 2.1 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V5:
        {
            log_printf( &logger, " Output voltage: 2.5 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V7:
        {
            log_printf( &logger, " Output voltage: 2.7 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V8:
        {
            log_printf( &logger, " Output voltage: 2.8 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_3V0:
        {
            log_printf( &logger, " Output voltage: 3.0 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_3V3:
        {
            log_printf( &logger, " Output voltage: 3.3 V\r\n\n" );
            break;
        }
    }
    if ( ++vout > STEPDOWN3_OUT_VOLTAGE_3V3 )
    {
        vout = STEPDOWN3_OUT_VOLTAGE_1V6;
    }
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ END
/*!
 * @file main.c
 * @brief Step Down 3 Click Example.
 *
 * # Description
 * This example demonstrates the use of Step Down 3 click board by
 * iterating through the entire output voltage range.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and logger, then enables the click board and disables
 * the auxiliary output.
 *
 * ## Application Task
 * Changes the output voltage every 3 seconds and displays the set voltage output value
 * on the USB UART.
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "stepdown3.h"

static stepdown3_t stepdown3;   /**< Step Down 3 Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    stepdown3_cfg_t stepdown3_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.
    stepdown3_cfg_setup( &stepdown3_cfg );
    STEPDOWN3_MAP_MIKROBUS( stepdown3_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == stepdown3_init( &stepdown3, &stepdown3_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    stepdown3_enable_device ( &stepdown3 );
    stepdown3_disable_aux_output ( &stepdown3 );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    static uint8_t vout = STEPDOWN3_OUT_VOLTAGE_1V6;
    stepdown3_set_output_voltage ( &stepdown3, vout );
    switch ( vout )
    {
        case STEPDOWN3_OUT_VOLTAGE_1V6:
        {
            log_printf( &logger, " Output voltage: 1.6 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_1V8:
        {
            log_printf( &logger, " Output voltage: 1.8 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V1:
        {
            log_printf( &logger, " Output voltage: 2.1 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V5:
        {
            log_printf( &logger, " Output voltage: 2.5 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V7:
        {
            log_printf( &logger, " Output voltage: 2.7 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V8:
        {
            log_printf( &logger, " Output voltage: 2.8 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_3V0:
        {
            log_printf( &logger, " Output voltage: 3.0 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_3V3:
        {
            log_printf( &logger, " Output voltage: 3.3 V\r\n\n" );
            break;
        }
    }
    if ( ++vout > STEPDOWN3_OUT_VOLTAGE_3V3 )
    {
        vout = STEPDOWN3_OUT_VOLTAGE_1V6;
    }
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ END
/*!
 * @file main.c
 * @brief Step Down 3 Click Example.
 *
 * # Description
 * This example demonstrates the use of Step Down 3 click board by
 * iterating through the entire output voltage range.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and logger, then enables the click board and disables
 * the auxiliary output.
 *
 * ## Application Task
 * Changes the output voltage every 3 seconds and displays the set voltage output value
 * on the USB UART.
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "stepdown3.h"

static stepdown3_t stepdown3;   /**< Step Down 3 Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    stepdown3_cfg_t stepdown3_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.
    stepdown3_cfg_setup( &stepdown3_cfg );
    STEPDOWN3_MAP_MIKROBUS( stepdown3_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == stepdown3_init( &stepdown3, &stepdown3_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    stepdown3_enable_device ( &stepdown3 );
    stepdown3_disable_aux_output ( &stepdown3 );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void ) 
{
    static uint8_t vout = STEPDOWN3_OUT_VOLTAGE_1V6;
    stepdown3_set_output_voltage ( &stepdown3, vout );
    switch ( vout )
    {
        case STEPDOWN3_OUT_VOLTAGE_1V6:
        {
            log_printf( &logger, " Output voltage: 1.6 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_1V8:
        {
            log_printf( &logger, " Output voltage: 1.8 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V1:
        {
            log_printf( &logger, " Output voltage: 2.1 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V5:
        {
            log_printf( &logger, " Output voltage: 2.5 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V7:
        {
            log_printf( &logger, " Output voltage: 2.7 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_2V8:
        {
            log_printf( &logger, " Output voltage: 2.8 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_3V0:
        {
            log_printf( &logger, " Output voltage: 3.0 V\r\n\n" );
            break;
        }
        case STEPDOWN3_OUT_VOLTAGE_3V3:
        {
            log_printf( &logger, " Output voltage: 3.3 V\r\n\n" );
            break;
        }
    }
    if ( ++vout > STEPDOWN3_OUT_VOLTAGE_3V3 )
    {
        vout = STEPDOWN3_OUT_VOLTAGE_1V6;
    }
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

// ------------------------------------------------------------------------ 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.