Beginner
10 min

Keep your electronics running smoothly with the help of LS12052BD33 and PIC18F57Q43

Current storm? eFuse to the rescue!

eFuse 7 Click with Curiosity Nano with PIC18F57Q43

Published Feb 13, 2024

Click board™

eFuse 7 Click

Dev. board

Curiosity Nano with PIC18F57Q43

Compiler

NECTO Studio

MCU

PIC18F57Q43

Safeguard your electronic circuits from overcurrent events and ensure uninterrupted operation and longevity for your devices.

A

A

Hardware Overview

How does it work?

eFuse 7 Click is based on the LS12052BD33, an eFuse with over-voltage protection and blocking FET control from Littelfuse. It is a current limit load switch with an integrated power load switch designed to manage current/voltage/start-up voltage ramp to the connected load. The internal MOSFET of the device will start conducting and allowing current to flow from IN to OUT as VIN rises by enabling the eFuse with an accurate ON/OFF threshold of 1.29V and 1.19V, respectively. After a Start-Up sequence, the eFuse will actively monitor its load current and input voltage. The eFuse will ensure that any harmful spikes are

safely clamped to a  pre-determined level at the output. The eFuse will shut down its internal MOSFET if the overload of the current limit is exceeded or the device’s temperature exceeds its threshold. The eFuse uses the TP86R203NL, an N-channel MOS from Toshiba, as a gate to the output screw terminal. The current limit on this eFuse 7 Click can be programmed. For this purpose, there is the AD5227, a 64-position up/down control digital potentiometer from Analog Devices. This 10K end-to-end potentiometer, in variable resistor configuration, is used to feed the current limit program pin of the eFuse. eFuse 7 Click uses a

simple 3-Wire serial interface of the digital potentiometer to allow the host MCU to set the current limit to this Click board™. Over the RST pin, you can enable the eFuse with the logic HIGH. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VIO 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.

eFuse 7 Click hardware overview image

Features overview

Development board

PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive

mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI

GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.

PIC18F57Q43 Curiosity Nano double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC

MCU Memory (KB)

128

Silicon Vendor

Microchip

Pin count

48

RAM (Bytes)

8196

You complete me!

Accessories

Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.

Curiosity Nano Base for Click boards accessories 1 image

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Reset
PA7
RST
SPI Chip Select
PD4
CS
SPI Clock
PC6
SCK
NC
NC
MISO
SPI Data IN
PC4
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
NC
NC
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

Click board™ Schematic

eFuse 7 Click Schematic schematic

Step by step

Project assembly

Curiosity Nano Base for Click boards front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Curiosity Nano with PIC18F57Q43 as your development board.

Curiosity Nano Base for Click boards front image hardware assembly
Charger 27 Click front image hardware assembly
PIC18F47Q10 Curiosity Nano front image hardware assembly
Prog-cut hardware assembly
Charger 27 Click complete accessories setup image hardware assembly
Board mapper by product8 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
PIC18F57Q43 Curiosity 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 eFuse 7 Click driver.

Key functions:

  • efuse7_enable_output - eFuse 7 output enable function.

  • efuse7_wiper_inc - eFuse 7 wiper position increase function.

  • efuse7_set_limit - eFuse 7 set current limit function.

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 eFuse 7 Click Example.
 *
 * # Description
 * This library contains API for the eFuse 7 Click driver.
 * This driver provides the functions to set the current limiting conditions 
 * in order to provide the threshold of the fault conditions.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initialization of Click module and UART log, then performing default 
 * configuration and setting a current limit to 1 A.
 *
 * ## Application Task
 * This example demonstrates the use of the eFuse 7 Click board.
 * Reading user's input from UART Terminal and using it as an index 
 * for an array of pre-calculated values that define the current limit level.
 * Results are being sent to the UART Terminal, where you can track their changes.
 *
 * @author Stefan Ilic
 *
 */

#include "board.h"
#include "log.h"
#include "efuse7.h"

static efuse7_t efuse7;   /**< eFuse 7 Click driver object. */
static log_t logger;      /**< Logger object. */

const uint8_t limit_value_op[ 8 ] = 
{ 
    EFUSE7_CURRENT_LIMIT_1A, 
    EFUSE7_CURRENT_LIMIT_2A,
    EFUSE7_CURRENT_LIMIT_2A5,
    EFUSE7_CURRENT_LIMIT_3A, 
    EFUSE7_CURRENT_LIMIT_3A5,
    EFUSE7_CURRENT_LIMIT_4A,
    EFUSE7_CURRENT_LIMIT_4A5,
    EFUSE7_CURRENT_LIMIT_5A,
};

static void display_selection ( void ) 
{
    log_printf( &logger, "  To select current limit  \r\n" );
    log_printf( &logger, "  Send one of the numbers: \r\n" );
    log_printf( &logger, "- - - - - - - - - - - - - -\r\n" );
    log_printf( &logger, " '0' - Limited to 1   A  \r\n" );
    log_printf( &logger, " '1' - Limited to 2   A  \r\n" );
    log_printf( &logger, " '2' - Limited to 2.5 A  \r\n" );
    log_printf( &logger, " '3' - Limited to 3   A  \r\n" );
    log_printf( &logger, " '4' - Limited to 3.5 A  \r\n" );
    log_printf( &logger, " '5' - Limited to 4   A  \r\n" );
    log_printf( &logger, " '6' - Limited to 4.5 A  \r\n" );  
    log_printf( &logger, " '7' - Limited to 5   A  \r\n" );  
    log_printf( &logger, "---------------------------\r\n" );
}

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    efuse7_cfg_t efuse7_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.
    efuse7_cfg_setup( &efuse7_cfg );
    EFUSE7_MAP_MIKROBUS( efuse7_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == efuse7_init( &efuse7, &efuse7_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( EFUSE7_ERROR == efuse7_default_cfg ( &efuse7 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
    display_selection( );
    Delay_ms ( 100 );
}

void application_task ( void ) 
{
    static char index;
    
    if ( 1 == log_read( &logger, &index, 1 ) ) 
    {
        if ( ( index >= '0' ) && ( index <= '7' ) ) 
        {
            efuse7_set_limit ( &efuse7, limit_value_op[ index - 48 ] );
            log_printf( &logger, "  >>> Selected mode %c     \r\n", index );
            log_printf( &logger, "---------------------------\r\n" );
            Delay_ms ( 100 );
        }
        else 
        { 
            log_printf( &logger, "    Data not in range!    \r\n" );
            log_printf( &logger, "---------------------------\r\n" );
            display_selection( );
            Delay_ms ( 100 );
        }
    }
}

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.