中级
30 分钟

使用BTS7008-1EPA和STM32L496AG的智能电源开关保护您的项目

高边卓越:精确控制10A负载和高浪涌电流

PROFET Click - 10A with Discovery kit with STM32L496AG MCU

已发布 7月 22, 2025

点击板

PROFET Click - 10A

开发板

Discovery kit with STM32L496AG MCU

编译器

NECTO Studio

微控制器单元

STM32L496AG

通过我们的智能高侧解决方案,重新定义功率开关技术,该解决方案处理10A负载和高涌入电流,同时通过ReverSave™反向极性保护保护您的系统。

A

A

硬件概览

它是如何工作的?

PROFET Click - 10A基于来自Infineon Technologies的单通道智能高侧功率开关BTS7008-1EPA,具有嵌入式保护和诊断功能。BTS7008-1EPA具有适用于10A负载的驱动能力,并配备“ReverseON”功能,可在反向极性情况下导致功率晶体管开启。它还提供了出色的能源效率,降低了电流消耗,具有最先进的电流感知精度,以及更快的开关/斜率速率,而不会对电磁兼容性产生影响,使其适用于电阻性、感性和电容性负载,替换电机械继电器、保险丝和离散电路等用途。该Click board™使用三个数字引脚进行直接控制。

标记为IN的输入引脚路由到mikroBUS™插座的PWM引脚,激活相应的输出通道标记为VOUT。此外,路由到mikroBUS™插座的CS引脚的诊断使能(DEN)引脚控制诊断和保护电路。结合IN引脚,它使选择适当的操作状态成为可能:休眠、待机和活动模式。BTS7008-1EPA受到过温、过载、反向供电(GND和VIN被反向供电)和过电压的保护。过温度和过载保护在设备不处于休眠模式时工作,而过电压保护在所有操作模式下都起作用。为了诊断目的,BTS7008-1EPA在mikroBUS™插座的AN引脚上结合数字和模拟信号。PROFET Click支

持用于BTS7008-1EPA的外部电源,可连接到标记为VIN的输入端子,并且应在6V到18V范围内。VIN具有欠压检测电路,如果应用电压低于欠压阈值,则防止功率输出级和诊断的激活。一个标记为VIN的红色LED电源指示灯指示外部电源的存在。该Click board™只能以3.3V逻辑电压电平操作。在使用具有不同逻辑电平的MCU之前,板上必须执行适当的逻辑电压电平转换。此外,它配备了一个包含函数和示例代码的库,可用作进一步开发的参考。

PROFET Click - 10A hardware overview image

功能概述

开发板

32L496GDISCOVERY Discovery 套件是一款功能全面的演示和开发平台,专为搭载 Arm® Cortex®-M4 内核的 STM32L496AG 微控制器设计。该套件适用于需要在高性能、先进图形处理和超低功耗之间取得平衡的应用,支持无缝原型开发,适用于各种嵌入式解决方案。STM32L496AG 采用创新的节能架构,集成

了扩展 RAM 和 Chrom-ART 图形加速器,在提升图形性能的同时保持低功耗,使其特别适用于音频处理、图形用户界面和实时数据采集等对能效要求较高的应用。为了简化开发流程,该开发板配备了板载 ST-LINK/V2-1 调试器/编程器,提供即插即用的调试和编程体验,使用户无需额外硬件即可轻松加载、调

试和测试应用程序。凭借低功耗特性、增强的内存能力以及内置调试工具,32L496GDISCOVERY 套件是开发先进嵌入式系统、实现高效能解决方案的理想选择。

Discovery kit with STM32L496AG MCU double side image

微控制器概述 

MCU卡片 / MCU

STM32L496AG Image

建筑

ARM Cortex-M4

MCU 内存 (KB)

1024

硅供应商

STMicroelectronics

引脚数

169

RAM (字节)

327680

使用的MCU引脚

mikroBUS™映射器

Diagnosis Signal
PA4
AN
NC
NC
RST
Diagnosis Enable
PG11
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Output Channel Activation
PA0
PWM
NC
NC
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

PROFET Click - 10A Schematic schematic

一步一步来

项目组装

Discovery kit with STM32H750XB MCU front image hardware assembly

从选择您的开发板和Click板™开始。以Discovery kit with STM32L496AG MCU作为您的开发板开始。

Discovery kit with STM32H750XB MCU front image hardware assembly
Thermo 21 Click front image hardware assembly
Prog-cut hardware assembly
Thermo 21 Click complete accessories setup image hardware assembly
Board mapper by product7 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
Discovery kit with STM32H750XB MCU NECTO MCU Selection Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto image step 11 hardware assembly

实时跟踪您的结果

应用程序输出

1. 应用程序输出 - 在调试模式下,“应用程序输出”窗口支持实时数据监控,直接提供执行结果的可视化。请按照提供的教程正确配置环境,以确保数据正确显示。

2. UART 终端 - 使用UART Terminal通过USB to UART converter监视数据传输,实现Click board™与开发系统之间的直接通信。请根据项目需求配置波特率和其他串行设置,以确保正常运行。有关分步设置说明,请参考提供的教程

3. Plot 输出 - Plot功能提供了一种强大的方式来可视化实时传感器数据,使趋势分析、调试和多个数据点的对比变得更加直观。要正确设置,请按照提供的教程,其中包含使用Plot功能显示Click board™读数的分步示例。在代码中使用Plot功能时,请使用以下函数:plot(insert_graph_name, variable_name);。这是一个通用格式,用户需要将“insert_graph_name”替换为实际图表名称,并将“variable_name”替换为要显示的参数。

软件支持

库描述

该库包含 PROFET Click - 10A 驱动程序的 API。

关键功能:

  • profet_read_an_pin_voltage - PROFET读取AN引脚电压级别功能

  • profet_set_mode - PROFET设置模式

开源

代码示例

完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio 应用程序代码也可以在MIKROE的GitHub账户中找到。

/*!
 * @file main.c
 * @brief PROFET 10A Click Example.
 *
 * # Description
 * This example showcases the ability of the PROFET 10A Click board.
 * It configures Host MCU for communication and then enables 
 * and disables output channel. Besides that, it reads the voltage 
 * of IS pin and calculates current on output.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initialization of the communication modules(ADC and UART) 
 * and additional pins for controlling the device.
 *
 * ## Application Task
 * On every iteration of the task device switches between 
 * DIAGNOSTIC and OFF mode while it reads the voltage of IS pin 
 * and with that calculates current on output.
 * 
 * @note
 * Formula for calculating current on load: 
 * I_load = voltage(IS) x kILIS / 1.2 kΩ
 *
 * Click board won't work properly on the PIC18F97J94 MCU card.
 * 
 * @author Luka FIlipovic
 *
 */

#include "board.h"
#include "log.h"
#include "profet10a.h"

static profet10a_t profet10a;   /**< PROFET 10A Click driver object. */
static log_t logger;    /**< Logger object. */

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    profet10a_cfg_t profet10a_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.
    profet10a_cfg_setup( &profet10a_cfg );
    PROFET10A_MAP_MIKROBUS( profet10a_cfg, MIKROBUS_1 );
    if ( profet10a_init( &profet10a, &profet10a_cfg ) == ADC_ERROR )
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
    
    profet10a_set_mode( &profet10a, PROFET10A_DIAGNOSTIC_ON );
    Delay_ms ( 1000 );
}

void application_task ( void )
{
    static uint8_t mode = PROFET10A_DIAGNOSTIC_ON;
    float profet10a_an_voltage = 0;
    
    profet10a_set_mode( &profet10a, mode );
    
    if ( PROFET10A_DIAGNOSTIC_ON == profet10a.mode )
    {
        mode = PROFET10A_MODE_OFF;
        log_printf( &logger, " > Output ON diagnostic mode\r\n" );
        Delay_ms ( 1000 ); 
        Delay_ms ( 1000 );
    }
    else
    {
        mode = PROFET10A_DIAGNOSTIC_ON;
        log_printf( &logger, " > Output OFF\r\n" );
    }

    if ( profet10a_read_an_pin_voltage ( &profet10a, &profet10a_an_voltage ) != ADC_ERROR )
    {
        log_printf( &logger, " > IS Voltage \t~ %.3f[V]\r\n", profet10a_an_voltage );
        
        float current = profet10a_an_voltage * profet10a.kilis / profet10a.rsens;
        log_printf( &logger, " > OUT Current \t~ %.3f[A]\r\n", current );
    }  
    
    log_printf( &logger, "*******************************************\r\n" );
    
    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

额外支持

资源

喜欢这个项目吗?

'购买此套件' 按钮会直接带您进入购物车,您可以在购物车中轻松添加或移除产品。

想查看更多

类似项目