中级
30 分钟

使用A80604-1和STM32F302VC简化多LED的管理

简单高效地照亮您的世界!

LED Driver 13 Click with CLICKER 4 for STM32F302VCT6

已发布 7月 22, 2025

点击板

LED Driver 13 Click

开发板

CLICKER 4 for STM32F302VCT6

编译器

NECTO Studio

微控制器单元

STM32F302VC

使用我们的 LED 驱动解决方案,将您的照明设置变成杰作,轻松控制多个 LED,让您专注于设计的辉煌。

A

A

硬件概览

它是如何工作的?

LED Driver 13 Click 基于 A80604-1,这是一款用于汽车应用的多输出 LED 驱动器,设计工作频率为 400kHz,来自 Allegro Microsystems。A80604-1 实现了带有板载外部 N 沟道 MOSFET 栅极驱动器的电流模式升压/SEPIC 转换器。因此,它在输出电压约为 26V 时,每通道提供 150mA 的输出电流,受 A80604-1 的输入电压限制,输入电压范围必须在 6V 至 18V 之间才能正常工作。它还集成了保护电路,以防止输出短路、过压、LED 短路保护和过温保护。该 Click board™ 提供两种实现 LED 调光的方法:通过板载电位计进行模拟调光,或通过施加在标记为 PWM 的板载头上的外部 PWM 信号进行 PWM 调光,使用来自 mikroBUS™ 插

座的 PWM 引脚进行 PWM 调光。使用专利的 Pre-Emptive Boost 控制,通过 PWM 调光 200Hz,可以实现 15,000:1 的 LED 亮度对比度。通过 PWM 和模拟调光的组合,可以实现更高的 150,000:1 对比度。模拟调光选择可以通过将标记为 ADIM SEL 的 SMD 跳线置于标记为 POT 或 PWM 的适当位置来进行。A80604-1 的开关频率可以外部同步到外部时钟或内部生成 - 编程在 260kHz 到 2.3MHz 之间。提供扩频技术(具有用户可编程的抖动范围和调制频率)以减少 EMI。板载头标记为 CLKO 的时钟输出信号允许其他转换器同步到 A80604-1 的开关频率。如产品描述中所述,LED Driver 13 Click 使用多个 GPIO 引脚与 MCU 通信。标记为

 mikroBUS™ 插座 EN 的使能引脚用于优化板的电源开/关目的。此外,它还使用标记为 FLT 并路由到 mikroBUS™ 插座 INT 引脚的故障引脚,如果在操作期间发生任何故障,则向外部系统指示上述故障情况。此故障信号还通过标记为 FAULT 的红色 LED 进行视觉指示。一旦故障消除,软启动过程将继续。该 Click board™ 可以通过 VCC SEL 跳线选择使用 3.3V 或 5V 逻辑电压电平。这使得具有 3.3V 和 5V 功能的 MCU 可以正确使用通信线路。此外,该 Click board™ 配备了包含易于使用的功能和示例代码的库,可以作为进一步开发的参考。

LED Driver 13 Click hardware overview image

功能概述

开发板

Clicker 4 for STM32F3 是一款紧凑型开发板,作为完整的解决方案而设计,可帮助用户快速构建具备独特功能的定制设备。该板搭载 STMicroelectronics 的 STM32F302VCT6 微控制器,配备四个 mikroBUS™ 插槽用于连接 Click boards™、完善的电源管理功能以及其他实用资源,是快速开发各类应用的理想平台。其核心 MCU STM32F302VCT6 基于高性能 

Arm® Cortex®-M4 32 位处理器,运行频率高达 168MHz,处理能力强大,能够满足各种高复杂度任务的需求,使 Clicker 4 能灵活适应多种应用场景。除了两个 1x20 引脚排针外,板载最显著的连接特性是四个增强型 mikroBUS™ 插槽,支持接入数量庞大的 Click boards™ 生态系统,该生态每日持续扩展。Clicker 4 各功能区域标识清晰,界面直观简洁,极大

提升使用便捷性和开发效率。Clicker 4 的价值不仅在于加速原型开发与应用构建阶段,更在于其作为独立完整方案可直接集成至实际项目中,无需额外硬件修改。四角各设有直径 4.2mm(0.165")的安装孔,便于通过螺丝轻松固定。对于多数应用,只需配套一个外壳,即可将 Clicker 4 开发板转化为完整、实用且外观精美的定制系统。

CLICKER 4 for STM32F302VCT6 double image

微控制器概述 

MCU卡片 / MCU

STM32F302VC Image

建筑

ARM Cortex-M4

MCU 内存 (KB)

256

硅供应商

STMicroelectronics

引脚数

100

RAM (字节)

40960

使用的MCU引脚

mikroBUS™映射器

NC
NC
AN
NC
NC
RST
Enable
PA4
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
PWM Signal
PE9
PWM
Fault Indicator
PD0
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

LED Driver 13 Click Schematic schematic

一步一步来

项目组装

PIC32MZ MXS Data Capture Board front image hardware assembly

从选择您的开发板和Click板™开始。以CLICKER 4 for STM32F302VCT6作为您的开发板开始。

PIC32MZ MXS Data Capture Board front image hardware assembly
Thermo 21 Click front image hardware assembly
Thermo 21 Click complete accessories setup image hardware assembly
Board mapper by product6 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
PIC32MZ MXS Data Capture Board 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

软件支持

库描述

该库包含 LED Driver 13 Click 驱动程序的 API。

关键功能:

  • leddriver13_set_enable - LED Driver 13 设置启用功能

  • leddriver13_pwm_start - LED Driver 13 启动 PWM 模块

  • leddriver13_set_duty_cycle - LED Driver 13 设置 PWM 占空比

开源

代码示例

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

/*!
 * @file main.c
 * @brief LEDDriver13 Click example
 *
 * # Description
 * This library contains API for LED Driver 13 Click driver.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and executes the Click default configuration which
 * starts the PWM module and sets the LEDs current to minimum.
 *
 * ## Application Task
 * This is an example that demonstrates the use of the LED Driver 13 Click board™.
 * The app controls the LEDs brightness by changing the PWM duty cycle.
 * The PWM duty cycle percentage will be logged on the USB UART.
 *
 * @author Nenad Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "leddriver13.h"


static leddriver13_t leddriver13;
static log_t logger;

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    leddriver13_cfg_t leddriver13_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.
    leddriver13_cfg_setup( &leddriver13_cfg );
    LEDDRIVER13_MAP_MIKROBUS( leddriver13_cfg, MIKROBUS_1 );
    if ( PWM_ERROR == leddriver13_init( &leddriver13, &leddriver13_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    if ( LEDDRIVER13_ERROR == leddriver13_default_cfg ( &leddriver13 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    
    log_info( &logger, " Application Task " );
    
    leddriver13_set_duty_cycle ( &leddriver13, 0.01 );
    Delay_ms ( 100 );
}

void application_task ( void ) 
{
    static int8_t duty_cnt = 1;
    static int8_t duty_inc = 1;
    float duty = duty_cnt / 1000.0;
    
    leddriver13_set_duty_cycle ( &leddriver13, duty );
    log_printf( &logger, "> Duty: %.1f%%\r\n", duty * 100 );
    Delay_ms ( 100 );
    
    if ( 30 == duty_cnt ) 
    {
        duty_inc = -1;
    }
    else if ( 0 == duty_cnt ) 
    {
        duty_inc = 1;
    }
    duty_cnt += duty_inc;
}

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

额外支持

资源

喜欢这个项目吗?

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