欢迎进入IT技术社区论坛,与200万技术人员互动交流 >>进入 主节点的请求帧在D1中给出需要分配帧ID的第一个帧在帧数组中的序号,一般来说,从节点所用到的所有帧的ID会被排列成一个帧数组。如果要分配帧ID,则通过D2到D5给出新的帧ID;如果要禁止某个帧,则将
欢迎进入IT技术社区论坛,与200万技术人员互动交流 >>进入
主节点的请求帧在D1中给出需要分配帧ID的第一个帧在帧数组中的序号,一般来说,从节点所用到的所有帧的ID会被排列成一个帧数组。如果要分配帧ID,则通过D2到D5给出新的帧ID;如果要禁止某个帧,则将这个帧对应的PID设为0x00;如果要继续使用现在的帧ID,则将这个帧对应的PID设为0xFF.(5)读取从节点信息读取节点信息根据D1中ID的值,可以读取不同的从节点信息。目前,只规定了ID为0和ID为1的情况,其他可保留或由用户自己确定。
3 LIN通信的实现
3.1 TLE9832的LIN模块
TLE9832是一款由英飞凌公司生产的8位功率级单片机,专门用于车窗控制。其中的LIN总线模块支持LIN2.1和LIN2.0,并向下兼容LIN 1.3.该模块可以工作在普通模式、接收模式和禁止模式下。各个模式的特点如表1所列。
其中,普通模式又可根据传输速率的大小分为低速模式、中速模式、高速模式和Flash模式。低速模式的最大传输速率为10.4 kbps;中速模式是普通的LIN传输模式,最大传输速率为20 kbps;高速模式的最大传输速率为40 kbps;Flash模式的最大传输速率为11 5 khps.为了避免打断传输过程,在普通模式下禁止改变传输速率。正确的做法是先禁止发送功能,再改变传输速率,最后允许发送功能。
LIN模块在普通模式下还建立了一种自动省电机制。当发送队列中没有数据时,将自动禁止发送功能;当有发送请求时,将自动开启发送功能。
3.2基于TLE9832的车窗防夹控制系统
基丁TLE9832的防夹车窗控制系统是英飞凌-同济微控制器与嵌入式系统实验室的最新研究成果。用户可以通过按键或者LIN总线控制车窗的上升和下降。基于TLE9832的防夹车窗系统原理图如图4所示。可通过控制PWM信号控制电机的转速,而霍尔传感器TLE4966又会采集电机的转速并传送给TLE9832,这样就构成了闭环控制。此外,电机的电枢电流在转化为电压信号后,被传送给TLE9832的ADC模块。如果车窗在上升过程中遇到不正常的阻力,电枢电流和电机转速都会发生异常的变化,TLE9832可以根据这种变化判断是否执行防夹算法,避免伤害乘客。
3.3 LIN通信部分的软件设计
LIN通信部分的程序流程如图5所示。可将车窗控制器中LIN通信部分的程序分为两个部分:①第一部分为初始化,在每次重新上电后,程序都会首先读取Flash中的数据,若0x8000中的数据为0x78,则判断产品在出厂后执行过保存配置的功能。所以程序会将存储在Flash中的NAD和帧ID读出来,作为当前的NAD和帧ID.接着是初始化LIN模块,包括设置与LIN通信相关的定时器和UART等外设,设置从节点的各个参数、波特率等。
②第二部分则放在定时器中断里面,在每次中断时进行节点配置、数据的发送和接收。首先是根据帧ID判断有无节点配置任务,若有则根据SID执行各种节点配置任务;接着根据收到的数据帧内容控制车窗的自动上升和自动下降;最后将车窗信息,包括电枢电流、车窗位置等发给主节点。
4 LIN通信的测试结果
本测试借助Kvaser公司出品的LIN通信测试工具Lcaf Professional LIN及其配套软件CANLab完成。测试时测试工具设置为主节点,TLE9 832单片机设置为从节点,比特率设置为19200 bps.初始NAD设置为0x06,初始帧ID为无条件帧0x00、0x01和诊断配置帧0x3C、0x3D,Suppli erID和Function ID都为0x0000.首先测试节点配置的各个功能:先测试分配NAD功能,将NAD修改为0x03;接着测试有条件分配NAD功能,将NAD修改为0x08;然后测试分配一系列帧ID功能,并保存设置;最后重新上电,并读取从节点信息。节点配置功能的测试结果如图6所示。
然后通过LIN总线控制车窗自动上升和下降,测试结果如图7所示。
最后通过LIN总线获得车窗上升过程中电枢电流的数据,并转换成图形,如图8所示。其中电流值为经过A/D转换后的结果。
结语
本文基于LIN2.1协议设计了防夹车窗控制系统中的通信模块。可以看出,该模块可以很好地满足用户在数据传输和诊断等方面的需求。LIN总线自身的发展必将推动车身控制领域的进一步发展。
[1] [2]

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.

SQL commands in MySQL can be divided into categories such as DDL, DML, DQL, DCL, etc., and are used to create, modify, delete databases and tables, insert, update, delete data, and perform complex query operations. 1. Basic usage includes CREATETABLE creation table, INSERTINTO insert data, and SELECT query data. 2. Advanced usage involves JOIN for table joins, subqueries and GROUPBY for data aggregation. 3. Common errors such as syntax errors, data type mismatch and permission problems can be debugged through syntax checking, data type conversion and permission management. 4. Performance optimization suggestions include using indexes, avoiding full table scanning, optimizing JOIN operations and using transactions to ensure data consistency.

InnoDB achieves atomicity through undolog, consistency and isolation through locking mechanism and MVCC, and persistence through redolog. 1) Atomicity: Use undolog to record the original data to ensure that the transaction can be rolled back. 2) Consistency: Ensure the data consistency through row-level locking and MVCC. 3) Isolation: Supports multiple isolation levels, and REPEATABLEREAD is used by default. 4) Persistence: Use redolog to record modifications to ensure that data is saved for a long time.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment