中级
30 分钟

使用IA611和PIC32MZ2048EFM100创建定制的语音激活系统

说出你的需求,即刻实现!

Smart Mic Click with Curiosity PIC32 MZ EF

已发布 7月 22, 2025

点击板

Smart Mic Click

开发板

Curiosity PIC32 MZ EF

编译器

NECTO Studio

微控制器单元

PIC32MZ2048EFM100

识别较大句子或命令中的特定口头关键词或触发短语,以唤醒任何嵌入式系统。

A

A

硬件概览

它是如何工作的?

Smart Mic Click 基于 Knowles Electronics 的 IA611,这是一款灵活、低功耗、高度集成的语音和音频处理器系统。IA611 包含一个先进的 Knowles 音频优化 DSP 子系统,设计用于以低功耗计算密集型音频处理算法。它还包括一个系统控制单元 (SCU),用于处理电源管理状态(如睡眠模式)并生成内部时钟信号。IA611,“始终在线”声学处理器,具有语音唤醒和语音 ID 关键词检测器、三秒缓冲区,以及 Knowles 的高性能声学 SiSonicTM MEMS 技术,集成在一个封装中。IA611 可以处于以下操作模式之一。Bootloader 模式是指在上电后,IA611 等待固件下载或用例设置。在指令模式中,IA611 在固件下载后等待用例设置,而在开放 DSP 模式中,IA611 允许第三方算法。在正常操作模式中,IA611 可以处于软件或硬件通道

模式,作为主机的麦克风。语音唤醒模式允许基于内置关键词(OEM 关键词)、用户训练的关键词(用户关键词)或用户条件的 OEM 关键词(语音 ID)的低功耗语音唤醒。在此模式下,IA611 监控麦克风流的声学活动。当检测到声学活动时,IA611 自动进入略高的功耗模式,分析语音发音是否存在唤醒关键词。当检测到有效关键词时,IA611 会触发 mikroBUS™ 插座的 INT 引脚的中断,以触发完整的系统唤醒。如果未检测到关键词,设备将返回超低功耗模式,直到再次检测到声学活动。IA611 实现了各种控制接口,包括 UART、SPI 和带有控制接口和音频接口端口的 I2C 从接口。根据所需接口,用户必须填充所选跳线以激活该接口(SPI、I2C 或 UART)。使用 I2C 接口,用户可以选择额外激活 I2C 线上的 4.7kΩ 上拉

电阻,填充标记为 PULL-UP 的跳线。IA611 不需要特定的上电顺序,但需要 1.8V 的电压才能正确工作。因此,使用了一个小型调节 LDO,即 TC1015,从 3.3V mikroBUS™ 电源轨提供 1.8V 输出,并通过连接到 mikroBUS™ 插座 RST 引脚的 EN 引脚提供启用功能,提供开启/关闭电源传输到 TC1015 的开关操作。由于传感器操作需要 1.8V 的电源,此 Click board™ 还具有 TXS0108E 电压电平转换器。接口线被引导到电压电平转换器,使此 Click board™ 能够正确与 3.3V MCU 一起工作。此 Click board™ 只能在 3.3V 逻辑电压水平下运行。使用不同逻辑电平的 MCU 之前,板必须执行适当的逻辑电压电平转换。然而,该 Click board™ 配备了包含函数和示例代码的库,可作为进一步开发的参考。

Smart Mic Click hardware overview image

功能概述

开发板

Curiosity PIC32 MZ EF 开发板是一个完全集成的 32 位开发平台,特点是高性能的 PIC32MZ EF 系列(PIC32MZ2048EFM),该系列具有 2MB Flash、512KB RAM、集成的浮点单元(FPU)、加密加速器和出色的连接选项。它包括一个集成的程序员和调试器,无需额外硬件。用户可以通过 MIKROE 

mikroBUS™ Click™ 适配器板扩展功能,通过 Microchip PHY 女儿板添加以太网连接功能,使用 Microchip 扩展板添加 WiFi 连接能力,并通过 Microchip 音频女儿板添加音频输入和输出功能。这些板完全集成到 PIC32 强大的软件框架 MPLAB Harmony 中,该框架提供了一个灵活且模块化的接口

来应用开发、一套丰富的互操作软件堆栈(TCP-IP、USB)和易于使用的功能。Curiosity PIC32 MZ EF 开发板提供了扩展能力,使其成为连接性、物联网和通用应用中快速原型设计的绝佳选择。

Curiosity PIC32MZ EF double side image

微控制器概述 

MCU卡片 / MCU

default

建筑

PIC32

MCU 内存 (KB)

2048

硅供应商

Microchip

引脚数

100

RAM (字节)

524288

使用的MCU引脚

mikroBUS™映射器

NC
NC
AN
Enable
RA9
RST
SPI Chip Select
RPD4
CS
SPI Clock
RPD1
SCK
SPI Data OUT
RPD14
MISO
SPI Data IN
RPD3
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
Interrupt
RF13
INT
UART TX
RPD10
TX
UART RX
RPD15
RX
I2C Clock
RPA14
SCL
I2C Data
RPA15
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

Smart Mic Click Schematic schematic

一步一步来

项目组装

Curiosity PIC32MZ EF front image hardware assembly

从选择您的开发板和Click板™开始。以Curiosity PIC32 MZ EF作为您的开发板开始。

Curiosity PIC32MZ EF front image hardware assembly
GNSS2 Click front image hardware assembly
Prog-cut 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
Curiosity PIC32 MZ EF 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

软件支持

库描述

该库包含 Smart Mic Click 驱动程序的 API。

关键功能:

  • smartmic_wait_keyword - 此函数等待关键词事件,读取并返回关键词 ID 号。

  • smartmic_download_keyword - 此函数将关键词模型下载到模块。

  • smartmic_voice_make - 此函数执行语音生成功能。它停止当前通道,然后将数字增益设置为20dB,采样率设置为16K,帧大小设置为16毫秒,最后选择通道6并配置算法参数。

开源

代码示例

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

/*!
 * @file main.c
 * @brief SmartMic Click example
 *
 * # Description
 * This example demonstrates the use of Smart Mic Click board by programming 
 * it with 4 different keywords, and then waiting for a keyword event, 
 * parsing it and displaying on the USB UART.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and performs the Click default configuration 
 * which programs the device with system config, firmware, and 4 keywords 
 * ("Hello VoiceQ","Switch The Light","Next Song","Baidu Yixia") binaries.
 *
 * ## Application Task
 * Waits for a keyword event, parses it and displays on the USB UART 
 * an appropriate message for the detected keyword.
 * 
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "smartmic.h"

static smartmic_t smartmic;
static log_t logger;

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    smartmic_cfg_t smartmic_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.
    smartmic_cfg_setup( &smartmic_cfg );
    SMARTMIC_MAP_MIKROBUS( smartmic_cfg, MIKROBUS_1 );
    if ( SMARTMIC_OK != smartmic_init( &smartmic, &smartmic_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    
    log_printf( &logger, " Configuring device... \r\n" );
    
    if ( SMARTMIC_OK != smartmic_default_cfg ( &smartmic ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

void application_task ( void )
{
    switch ( smartmic_wait_keyword ( &smartmic ) )
    {
        case SMARTMIC_OEM1_KWD_DETECTED:
        {
            log_printf ( &logger, " Hello VoiceQ keyword detected!\r\n" );
            break;
        }
        case SMARTMIC_OEM2_KWD_DETECTED:
        {
            log_printf ( &logger, " Switch The Light keyword detected!\r\n" );
            break;
        }
        case SMARTMIC_OEM3_KWD_DETECTED:
        {
            log_printf ( &logger, " Next Song keyword detected!\r\n" );
            break;
        }
        case SMARTMIC_OEM4_KWD_DETECTED:
        {
            log_printf ( &logger, " Baidu YiXia keyword detected!\r\n" );
            break;
        } 
    }
}

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

额外支持

资源

喜欢这个项目吗?

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