初学者
10 分钟

使用IF-D91和STM32F302VC体验闪电般的数据传输速度和无与伦比的可靠性

通过光纤电缆使用光束发送和接收数据

Fiber Opt Click 3.3V with CLICKER 4 for STM32F302VCT6

已发布 7月 22, 2025

点击板

Fiber Opt Click 3.3V

开发板

CLICKER 4 for STM32F302VCT6

编译器

NECTO Studio

微控制器单元

STM32F302VC

通过引入光纤连接技术升级您的项目,确保信息流动迅速且不间断。

A

A

硬件概览

它是如何工作的?

Fiber Opt Click 3.3V 基于 Industrial Fiber Optics 的两种光纤组件:IF-D91 光纤光电二极管和 IF-E97 光纤 LED。IF-D91 是一种高速光电二极管检测器,封装在无连接器的塑料光纤封装中,光响应范围从 400 到 1100nm,兼容广泛的可见光和近红外 LED 以及激光二极管源。检测器封装具有内部微透镜和精密成型的 PBT 外壳,确保与标准 1000μm 核心 2.2mm 外套塑料光纤电缆有效的光耦合,该电缆支持高达  100Mbps 的数据速率。IF-D91 还可用于带宽高达 

70MHz 的模拟视频链接。另一种精密成型的 PBT 外 壳和内部微透镜的 IF-E97,是一种高光输出的可见红色 LED。外壳确保与相同标准的外套塑料光纤电缆有效的光耦合。输出光谱由峰值为 650nm 的 GaAlAs 芯片产生,这代表了 PMMA 塑料光纤的最佳传输窗口。可见红光在 PMMA 塑料光纤中的衰减低,有助于故障排除安装,这也是 IF-E97 实现 1Mbps 数据速率的主要原因。此 Click board™ 通过 mikroBUS™ 插座的可选引脚与宿主 MCU 通信,可以是 UART 或一

些通用引脚。通过 GPIO UART 选择跳线可以选择通信方式,UART 默认被选择。否则,可以直接通过 GPIO 引脚进行通信,其中 PWM 和 INT 引脚在 mikroBUS™ 插座中扮演该角色。此外,使用 AN 引脚,可以检测光纤光电二极管的模拟电压。此 Click board™ 只能在 3.3V 逻辑电压水平下操作。在使用具有不同逻辑电平的 MCU 之前,必须执行适当的逻辑电压水平转换。此外,它还配备了一个包含功能和示例代码的库,可用作进一步开发的参考。

Fiber Opt Click 3.3V 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™映射器

Analog Output
PC4
AN
NC
NC
RST
NC
NC
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
GPIO RX
PE9
PWM
GPIO TX
PD0
INT
GPIO TX
PA2
TX
GPIO RX
PA3
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

Fiber Opt Click 3.3V 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

软件支持

库描述

这个库包含 Fiber Opt Click 3.3V 驱动程序的 API。

关键功能:

  • fiberopt_generic_write - 通用单写函数。

  • fiberopt_generic_read - 通用单读函数。

开源

代码示例

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

/*!
 * \file 
 * \brief Fiber Opt Click example
 * 
 * # Description
 * This example demonstrates the use of an Fiber Opt click board by showing
 * the communication between the two click boards.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Initalizes device and makes an initial log.
 * 
 * ## Application Task
 * Depending on the selected application mode, it reads all the received data or 
 * sends the desired text message with the message counter once per second.
 * 
 * \author MikroE Team
 *
 */

#include "board.h"
#include "log.h"
#include "fiberopt.h"

// Comment out the line below in order to switch the application mode to receiver
#define DEMO_APP_TRANSMITTER

// Text message to send in the transmitter application mode
#define DEMO_TEXT_MESSAGE           "MIKROE - Fiber Opt click board\r\n\0"

static fiberopt_t fiberopt;
static log_t logger;

void application_init ( void )
{
    log_cfg_t log_cfg;
    fiberopt_cfg_t cfg;

    /** 
     * 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.
    fiberopt_cfg_setup( &cfg );
    FIBEROPT_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    fiberopt_init( &fiberopt, &cfg );

#ifdef DEMO_APP_TRANSMITTER
    log_printf( &logger, " Application Mode: Transmitter\r\n" );
#else
    log_printf( &logger, " Application Mode: Receiver\r\n" );
#endif
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

void application_task ( void )
{
#ifdef DEMO_APP_TRANSMITTER
    fiberopt_generic_write( &fiberopt, DEMO_TEXT_MESSAGE, strlen( DEMO_TEXT_MESSAGE ) );
    log_printf( &logger, "%s", ( char * ) DEMO_TEXT_MESSAGE );
    Delay_ms( 1000 ); 
#else
    uint8_t rx_byte = 0;
    if ( 1 == fiberopt_generic_read( &fiberopt, &rx_byte, 1 ) )
    {
       log_printf( &logger, "%c", rx_byte );
    }
#endif
}

int main ( void ) 
{
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}


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

额外支持

资源

喜欢这个项目吗?

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