从基础到实践(三十):CAN的硬件设计指南(一)

06-CAN电路设计 CAN电路设计 阅读详情

1. CAN总线硬件设计的重要性

CAN总线在汽车电子和工业控制领域扮演着神经系统的角色,负责连接各种电子控制单元(ECU)。但很多刚入门的工程师容易忽略一个关键点:CAN总线的稳定性不仅取决于协议和软件,更取决于硬件设计的质量。在实际项目中,我见过太多因为硬件设计不当导致的通信故障——从信号反射造成的误码到电磁干扰引发的系统崩溃。

记得有一次在汽车电子项目中,我们遇到了随机性的CAN通信中断。软件团队排查了几天都没找到原因,最后发现是PCB布局时差分线对长度偏差过大导致的。这个教训让我深刻意识到:硬件设计不是简单的连线游戏,而是需要精确计算的系统工程。

CAN总线硬件设计的核心目标是保证信号完整性和抗干扰能力。这涉及到四个关键环节:收发器选型、终端电阻配置、电源滤波电路设计和PCB布局规范。每个环节都需要精心设计,任何一个环节的疏忽都可能导致整个系统不稳定。

2. CAN收发器选型指南

2.1 关键参数解析

选择CAN收发器时,不能只看价格和封装。有几个关键参数直接影响系统性能:

供电电压范围:汽车电子通常需要4.5V-5.5V,而工业应用可能需要更宽的3.0V-5.5V范围。我在一个农业机械项目中就遇到过因为电压波动导致通信失败的情况——设备在冷启动时电压会瞬间跌至3.3V,幸亏选了宽压输入的TCAN1042才避免了问题。

静态功耗:对于电池供电的设备,睡眠模式功耗≤10μA至关重要。曾经有个物联网项目,因为忽略了静态功耗,电池寿命从预期的3年缩短到只有6个月。

ESD防护等级:汽车级要求±8kV(接触放电),工业设备至少需要±4kV。实际测试中,我发现很多故障都是静电放电引起的,良好的ESD防护可以省去后期的很多麻烦。

驱动能力:普通应用30mA就够了,但长距离传输需要60mA甚至80mA的驱动能力。有个工厂自动化项目,100米长的CAN总线经常出现错误,换成高驱动能力的收发器后就稳定了。

2.2 实际选型案例

根据

从基础到实践(三十二):CAN的设计指南—功能安全 在功能安全项目中,CAN芯片至关重要。它作为关键通信枢纽,承担高效、稳定的数据传输任务,确保系统各模块间信息准确交互 。其错误检测与处理能力,可及时规避潜在风险;高可靠性设计,保障系统在恶劣环境下正常运转,为自动驾驶、工业控制等领域的功能安全筑牢基础。 阅读详情

相关推荐

从基础到实践(三十):CAN的硬件防护与EMC设计指南

本文详细解析CAN总线的硬件防护与EMC设计指南,涵盖三级防护体系、TVS管选型、共模扼流圈应用及PCB布局策略。针对工业与汽车电子严苛环境,提供从基础到实践的EMC设计方法和测试验证要点,确保通信稳定性和抗干扰能力。

xx56789的博客 555

STM32 CAN通信工程实践:从硬件设计到HAL驱动深度解析

CAN总线是一种面向工业现场的多主、差分、仲裁型串行通信协议,其核心价值在于确定性实时性、强抗干扰能力与无中心故障容错机制。它不同于UART等点对点协议,依赖硬件仲裁、显隐性电平编码及严格终端匹配实现可靠通信。在STM32嵌入式系统中,利用内置bxCAN控制器配合TJA1050收发器,可构建低成本高鲁棒性的分布式传感器网络。关键技术环节包括:符合ISO 11898-2的信号完整性设计(如120Ω终端电阻布放、光耦隔离)、采样点精准配置的波特率时序规划,以及HAL库下发送邮箱管理与FIFO中断驱动的异步模型。

weixin_42466857的博客 812

STM32CAN硬件设计与电路图综合指南

STM32微控制器系列广泛应用于工业控制、医疗设备、汽车电子等多个领域,其中一个重要的原因在于其内置的CAN模块。本章旨在为读者提供对STM32微控制器中CAN模块功能的全面了解,涵盖基础通信原理,到配置与应用的深度解析。CAN(Controller Area Network)总线,作为一种有效的支持分布式实时控制的串行通信网络,被广泛应用于电子控制单元间的通信。STM32微控制器的CAN模块提供了一种实现CAN协议的硬件支持,允许设备进行数据传输和接收,支持标准和扩展报文格式。

weixin_30591519的博客 1311

AGV硬件设计全解析:从主控选型到故障排查

嵌入式系统是移动机器人的技术底座,其硬件架构直接决定整机性能与可靠性。理解主控算力选择、电机驱动功率估算、电源树设计及CAN总线通信等基本原理,是构建稳定AGV的基础。合理的硬件选型与EMC防护能显著提升复杂环境下的运行品质。磁条、二维码、激光SLAM等导航方式各有适用场景,需根据路径柔性需求取舍。从需求清单梳理到工程化落地,AGV硬件设计涵盖需求分析、模块选型、安全回路与故障排查等关键环节,为开发者提供了从理论到实践的完整参考。

weixin_42522575的博客 311

CAN硬件设计

描述了CAN总线工作原理,基于SJA对CAN总线进行开发和设计

CAN总线软硬件设计

CAN总线软硬件设计,实现CAN总线通讯双向收发,软件平台: 1、软件开发环境KEIL C 2、程序下载软件STC-ISP 硬件需要: 1、开发平台 2、USB-232线

AD9361 官方例程

文章目录一、官方资料1.1 介绍1.2 下载 和 使用1.3 相关资料二、步骤2.1 在Vivado中构建HDL2.2 在SDK中构建No- OS总结 一、官方资料 1.1 介绍 HDL参考设计介绍:AD9361 HDL Reference Designs 无操作系统介绍:AD9361 No-OS Software 1.2 下载 和 使用 HDL下载:Download HDL 在Vivado中构建HDL:Building HDL No-OS下载:Download No-OS 1.3 相关资料 AD

weixin_44630490的博客 3万+

告别Vysor!用Scrcpy在Mac上无线投屏安卓手机(附魅族16th闪退修复实战)

本文详细介绍了如何在Mac上配置和使用开源投屏工具Scrcpy,实现安卓手机无线投屏的高效解决方案。从基础环境准备到高级功能调优,包括无线连接配置、输入控制增强、多设备管理和性能优化等实用技巧,特别针对魅族16th等机型的闪退问题提供了修复方案,帮助用户彻底告别Vysor等商业软件。

weixin_28712661的博客 396

数字图像处理第九章笔记

目录一、腐蚀与膨胀1、腐蚀2、膨胀3、对偶性4、开操作与闭操作二、一些基本的形态学算法1、边界提取2、孔洞填充3、连通分量提取4、凸壳5、细化6、粗化7、骨架8、形态学重建三、灰度级形态学1、腐蚀和膨胀2、开运算和闭运算3、灰度级形态学算法 一、腐蚀与膨胀 1、腐蚀 腐蚀可以去除图像的某些部分。 2、膨胀 膨胀可以连接裂缝。 3、对偶性 膨胀和腐蚀彼此关于集合求补运算和反射运算是对偶的 4、开操作与闭操作 开操作:B对A先腐蚀,再进行膨胀 可以平滑物体轮廓,断开较窄的狭颈并消除较细的突出物。 闭操作

方悔读书迟 1375

【06】新国都——新国都 嵌入式笔试,校招,题目记录及解析

本文总结了新国都嵌入式校招笔试题目及解析,内容涵盖C语言基础、Linux系统、数据结构与算法等多个方面。主要包括:1)不定项选择题10道,涉及字符串常量、蓝牙与GPRS区别、编译错误识别等;2)判断题10道,考察Linux权限、循环控制、内存管理等;3)填空题5道,包括编码计算、逻辑运算、宏定义等;4)简答题2道,解析全局变量引用和进程线程区别。题目难度适中,重点考察嵌入式开发基础知识和编程能力,并提供详细解析和扩展知识链接,对准备嵌入式相关笔试具有参考价值。

程序员,他们想的是什么?他们想的永远都是技术,他们崇尚的也永远都是技术。 1434

OpenCloudOS9操作系统搭建Confluence8.2.1+Jira企业级WIKI

Atlassian Confluence是一个专业的企业知识管理与协同软件,可用于构建企业wiki

背锅神童的博客 1023

形状记忆合金热机械本构模型的ABAQUS子程序实现与Fortran\_ABAQUS编程实践

本文详细介绍了如何使用ABAQUS子程序实现形状记忆合金的热机械本构模型,并通过Fortran_ABAQUS进行编程实践。我们首先介绍了问题的背景和目标,然后讲解了如何在Fortran_ABAQUS子程序中实现热变形模型、应力应变关系和相变模型,最后进行了ABAQUS模拟,并分析了模拟结果。希望通过本文的讲解,能让大家更深入理解ABAQUS子程序以及Fortran的使用,也希望能对大家在进行相关学习或研究工作时提供一些帮助。

qq_38334677的博客 1328

ximalaya 新xm-sign逆向思路

本文主要介绍目标网站新xm-sign值的逆向思路。仅代表个人理解,如有其他建议可在评论区沟通。声明仅仅记录一下自己的学习方法,不作为其他参考、更不作为商业用途。如有侵犯请联系本人删除。

weixin_66580433的博客 2017

k8s 不同node之间pod ip不通

底层k8s使用calico网络,ipip网络模式,kubevirt启动了2台虚拟机;在这两台虚拟机上再搭建k8s,calico网络,ipip网络模式。说明:我是使用helm安装的calico,改这个模式要改crd资源ippools。其他方式安装的calico修改方法可能不一样。在虚拟机上的k8s上启动了2个pod,分布在不同的node上,这两个pod不能ping通对方的pod ip。修改虚拟机之上的k8s集群的calico网络的ipipMode为Never即可,之前使用的是Always。

weixin_40548182的博客 4056

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: EEPROM读写背后的中断艺术:CW32F030C8T6 I2C事件驱动编程详解
下一篇: 深入解析SFDP:串行Flash自动识别的关键技术
ruby5
博客等级 码龄15年 29粉丝 893原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值