中级
30 分钟

使用ATA663211和STM32L496AG在汽车和工业环境中实现实时监控和控制

LIN收发器实现低速数据通信的未来

ATA663211 Click with Discovery kit with STM32L496AG MCU

已发布 7月 22, 2025

点击板

ATA663211 Click

开发板

Discovery kit with STM32L496AG MCU

编译器

NECTO Studio

微控制器单元

STM32L496AG

我们的LIN收发器使车辆和工业系统能够以低速高效交换关键数据,确保通信无缝。

A

A

硬件概览

它是如何工作的?

ATA663211 Click基于Microchip的ATA663211,这是一款LIN收发器。它具有多种保护功能,例如过温保护、对GND和电池的短路保护、高级EMC和ESD等。集成的3.3V板载LDO电压调节器是MCP1804,这是一款带有关闭功能的LDO调节器。电压调节器和总线收发器的组合使得在LIN总线系统中开发简单但功能强大的从节点成为可能。这样,ATA663211 Click可以作为独立的LIN收发器使用,而无需连接到mikroBUS™插槽。板载的LDO(低压降稳压器)可通过VS线螺钉端子提供电源。这种调节电压也可在mikroBUS™插座的+3.3V导轨上提供,以给3.3V附加主机MCU供电。ATA663211 Click有几种工作模式。在正常模式下,LIN接口正在传输和接收数据。在睡眠模式下,传输路径被禁用,LIN收发器处于低功耗模式。失效安全模式在系统上电或唤醒事件后自动切换。在

此模式下,LIN收发器被关闭,并且禁止输出引脚被打开。对于典型的主节点应用,ATA663211需要将芯片的LBUS线连接到LIN总线的VBB,可通过安装的L-PULL跳线实现。在其他场景中,例如LIN从节点,可以移除此跳线。ATA663211使用UART RX和TX信号与MCU通信。除了通信,这些引脚还用于信号传递失效安全条件。LIN连接器上的欠压可能导致失效安全条件:低于3.9V将导致欠压条件,由RX引脚上的LOW逻辑状态和TX引脚上的HIGH逻辑状态表示。来自静默或睡眠模式的LIN唤醒事件由RX和TX引脚上的LOW逻辑状态表示。此事件通过LIN总线接收,并用于将ATA663211 click切换到活动状态。另一方面,TX上的Low和RX上的HIGH将表示本地唤醒。RX和TX信号也被路由到Click板边缘的标头上,因此它们可以独立于mikroBUS™插座使用。LIN收发器的禁止输

出引脚用于控制MCP1804 LDO的关断输入;因此,LIN收发器的供电引脚,就像LDO一样,使用LIN工作电压为LIN收发器的供电引脚提供电源。通过电阻分压器,可以通过mikroBUS™插座的INH引脚监测此线路上的电压。为了启用LIN收发器,默认情况下将EN SEL跳线设置为HI位置,从而启用收发器。将其设置为LOW位置允许您通过mikroBUS™插座上的EN引脚控制启用功能。此外,此引脚也被路由到第二对标头以在外部启用LIN收发器。此标头上的另一个引脚是WKin,用于唤醒设备的高电压输入。此Click板仅能使用3.3V逻辑电压电平操作。在使用具有不同逻辑电平的MCU之前,板上必须执行适当的逻辑电压电平转换。然而,Click板配备了一个包含函数和示例代码的库,可用作进一步开发的参考。

ATA663211 Click 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™映射器

Voltage Regulator Control
PA4
AN
NC
NC
RST
Device Mode Control
PG11
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
NC
NC
INT
UART TX
PG10
TX
UART RX
PB6
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

ATA663211 Click 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

软件支持

库描述

这个库包含ATA663211 Click驱动的API。

关键函数:

  • ata663211_generic_write - 通用写函数

  • ata663211_generic_read - 通用读函数。

开源

代码示例

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

/*!
 * \file 
 * \brief Ata663211 Click example
 * 
 * # Description
 * This example demonstrates the use of an ATA663211 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
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "ata663211.h"

// ------------------------------------------------------------------ VARIABLES

// 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 - ATA663211 Click board\r\n\0"

static ata663211_t ata663211;
static log_t logger;

// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    ata663211_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.
    ata663211_cfg_setup( &cfg );
    ATA663211_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    ata663211_init( &ata663211, &cfg );
#ifdef DEMO_APP_TRANSMITTER
    log_printf( &logger, " Application Mode: Transmitter\r\n" );
#else
    log_printf( &logger, " Application Mode: Receiver\r\n" );
#endif
}

void application_task ( void )
{
#ifdef DEMO_APP_TRANSMITTER
    ata663211_generic_write( &ata663211, 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 == ata663211_generic_read( &ata663211, &rx_byte, 1 ) )
    {
       log_printf( &logger, "%c", rx_byte );
    }
#endif
}

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

额外支持

资源

喜欢这个项目吗?

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