Realizing LIN Nodes Using Single Chip Microcomputer

Publisher:温文儒雅Latest update time:2012-01-18 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1.1 Introduction

LIN is the automotive communication protocol standard in low-cost networks. LIN (Local Interconnect Network) is a low-cost automotive network that complements the existing various automotive networks in terms of functionality. LIN will be the starting factor for the use of automotive hierarchical networks in cars due to its ability to improve quality and reduce costs. The standardization of LIN will simplify various existing multi-point solutions and will reduce development, production, service and logistics costs in the field of automotive electronics.

The LIN standard includes transmission protocol specifications, transmission media specifications, development tool interface specifications, and interfaces for software programming. LIN ensures the interoperability of network nodes in hardware and software and has predictable EMC functions.

1.2 Chip Introduction

The SPMC75 series MCU is designed and developed by Sunplus Technology Co., Ltd.

The high-performance 16-bit general-purpose MCU has strong anti-interference performance, rich and easy-to-use resources and excellent structure, especially the enhanced timing counter and PWM output functions. The SPMC75 series MCU uses the Lingyang u'nSP core, which is an efficient 16-bit CISC core. It supports high-performance operations such as multiplication, multiplication accumulation, 32/16-bit division, FIR, etc.; it supports two interrupt modes. It can easily generate various motor drive waveforms such as SPWM waves and space vector PWM (SVPWM).

In addition to the high-performance CPU, the SPMC75 series MCU also integrates a variety of functional modules: multi-function I/O port, synchronous and asynchronous serial port, high-performance ADC, ordinary timer counter, multi-function capture comparison module, BLDC motor drive dedicated position detection interface, two-phase incremental encoder interface, PWM generator that can generate various motor drive waveforms, etc. At the same time, the SPMC75 series microcontroller integrates 32K Words of Flash and 2K Words of SRAM. With these hardware support, the SPMC75 series microcontroller can complete complex applications such as household electric variable frequency drive, standard industrial variable frequency drive, multi-ring servo drive system, etc.

TJA1020 (Philips) is the interface between the LIN master/slave protocol controller and the LIN (Local Interconnect Network) physical bus, and is mainly used as a secondary network in vehicles. The baud rate used can be from 2.4 to 20Kbits/s. TJA1020 supports two operating modes: normal slope and low slope, and can switch between normal slope mode and low slope mode. TJA1020 also supports sleep mode to reduce system power consumption.

1.3 Introduction to LIN Bus

LIN (Local Interconnect Network) Bus is a serial communication bus that effectively supports the control of distributed mechanical and electronic nodes in automotive applications. Its scope of application is a multi-point bus with a single master node and a group of slave nodes. Its system structure is shown in Figure 1-1. The main features of the LIN Bus system are:

■ Single-master multi-slave organization (i.e. no bus arbitration), flexible configuration;
■ Low-cost hardware based on ordinary UART/SCI interface to implement low-cost software protocol;
■ Multi-point broadcast reception with time synchronization, slave nodes do not need quartz or ceramic resonators, and can achieve self-synchronization;
■ Guaranteed signal transmission delay time. Optional message frame length: 2, 4 and 8 bytes;
■ Data checksum security and error detection, automatic detection of faulty nodes in the network;
■ Use of semiconductor components with minimum cost (small patch, single-chip system).
■ Speed ​​up to 20kbit/s;

LIN Bus System Structure

Figure 1-1 LIN Bus system structure

1.4 Implementation of LIN protocol on SPMC75F2313A

LIN Bus is a simple single bus system with a relatively simple software protocol stack. A LIN network consists of a host node and more than one slave node. All nodes include slave service programs to send and receive data, and only one node includes a host service program. The host program is mainly used to send synchronization intervals, synchronization fields, and ID fields (can also be commands) to control and coordinate the orderly communication of each node.

1.5 System Design

The system circuit principle block diagram is shown in Error! Reference source not found. The circuit consists of two parts: MCU control core circuit and LIN interface.

The MCU control core circuit is mainly implemented by SPMC75F2313A, which mainly completes the implementation of LIN protocol and the control of the entire system. SPMC75F2313A integrates the necessary hardware to realize LIN bus nodes, including UART, capture input and sufficient timers. In particular, its capture input function provides great convenience for LIN frame header recognition, frame synchronization and baud rate measurement.

The LIN interface part is mainly composed of the LIN physical layer interface chip TJA1020, which mainly completes the mutual conversion between the MCU communication signal and the LIN physical bus signal, and provides an interface between the MCU and the LIN physical bus.

Hardware Schematic

Figure 1-8 Hardware schematic diagram

1.6 Conclusion

The newly launched SPMC75 by Sunplus Technology is a series of powerful industrial-grade MCUs with strong anti-interference capabilities. It integrates high-performance ADC, enhanced timer counter and other functional components, and powerful capture comparison function and PWM generation function, which makes it have outstanding performance in communication fields such as LIN, RF Mode, IrA, etc. SPMC75 series MCU can be used to easily form various simple and efficient communication systems.


1.4.1 LIN information Transmission

LIN information is transmitted in the form of messages. Message transmission is formed and controlled by the format of the message frame. The message frame transmits synchronization and identifier information from the host task to the slave task, and transmits the information of a slave task to all other slave tasks. The host task is located inside the host node, and it is responsible for the schedule of the message and sending the message header (HEADER). The slave task is located in all (i.e. host and slave) nodes, and one of them (host node or slave node) sends the response (RESPONSE) of the message.

As shown in Figure 1-2, a message frame consists of a message header sent by a host node and a response sent by a host or slave node. The message header of the message frame includes a synchronization interval field (SYNCH BREAK FIELD), a synchronization field (SYNCH FIELD) and an identifier field. The response (RESPONSE) of the message frame consists of 3 to 9 byte fields: 2, 4 or 8 bytes of data field (DATA FIELD) and a checksum field (CHECKSUM FIELD). The byte fields are separated by the inter-byte space, and the message header and response of the message frame are separated by an intra-frame response space. The minimum inter-byte space and intra-frame response space are 0, and the maximum length of these spaces is determined by the maximum length of the message frame TFRAME_MAX.

LIN message frame

Figure 1-2 LIN message frame

1.4.2 LIN Information Transmission Process

Figure 1-3 shows the data transmission from the LIN slave to the host. The entire process is coordinated by the host.

Transfer data from the slave to the master

Figure 1-3 Data transmission from slave to master

Figure 1-4 shows how a LIN host sends data to two or more slaves. The entire process is coordinated by the host.

The master sends data to two or more slaves

Figure 1-4 The host sends data to two or more slaves

Figure 1-5 shows the data transmission between slaves. The whole process is coordinated by the host.

Data transmission between slaves

Figure 1-5 Data transmission between slaves

1.4.3 LIN physical layer control

■ SYNCHRONISATION BREAK detection

In order to clearly identify the start of a message frame, the first field of a message frame is a synchronization break. The synchronization break field (SYNCH BREAK FIELD) is sent by the master task and synchronizes all slave tasks with the bus clock signal. The synchronization break field has two different parts as shown in Figure 1-6. The first part consists of a dominant bus level that lasts for TSYNBRK or longer (that is, the minimum is TSYNBRK but does not need to be very strict). The second part is followed by a recessive level that lasts at least TSYNDEL time, which serves as a synchronization delimiter. The second field allows the detection of the start bit of the next synchronization field (SYNCH FIELD). The maximum break and delimiter times are not precisely defined, but must fit within the overall time budget of the entire message header THEADER_MAX, which is defined in Table 1-1.

Synchronous interval field

Figure 1-6 Synchronous interval field

Table 1-1 Message timing

Timing of messages

The dominant level length of the sync break field is at least TSYNBRK (can be longer), which is measured in terms of the master bit timing. The minimum value should be based on the threshold required by the minimum local clock frequency specified by the connected slave node.

On the SPMC75F2313A, each time measurement in the synchronization interval is achieved through the capture input. The capture input of the SPMC75F2313A can easily measure TSYNBRK and TSYNDEL, and synchronize with the falling edge of TSYNDEL after the detection is completed.

■ Baud rate measurement

The baud rate measurement is performed on the LIN bus's SYNCH FIELD. The SYNCH FIELD contains the clock synchronization information. The format of the SYNCH FIELD is shown in Figure 1-7. It is achieved by sending "0x55" to the UART, which is reflected in 5 falling edges in the 8-bit timing (i.e., the edge from "hidden" to "dominant"). The capture input function of the SPMC75F2313A can be used to easily measure the time interval between two adjacent falling edges, and the baud rate can be calculated using this time interval.

Synchronous field diagram

Figure 1-7 Synchronous field diagram

Keywords:MCU Reference address:Realizing LIN Nodes Using Single Chip Microcomputer

Previous article:Using single chip microcomputer to transform old measuring instruments
Next article:Software UART based on μPD78045F microcontroller

Recommended ReadingLatest update time:2024-11-17 00:34

Introduction to the internal structure and functions of the AT89S51 microcontroller serial port
The internal structure of the AT89S51 microcontroller serial port is shown in the figure below. It has two physically independent receiving and transmitting buffers SBUF (special function registers), which can send and receive data at the same time. The sending buffer can only be written but not read, and the receivin
[Microcontroller]
Introduction to the internal structure and functions of the AT89S51 microcontroller serial port
Design of three-phase half-controlled rectifier circuit using PIC microcontroller chip
The three-phase half-controlled rectifier bridge circuit structure is a common rectifier circuit , which is easy to control and has low cost. This article introduces a three-phase half-controlled rectifier circuit based on PIC690 microcontroller and dedicated integrated trigger chip T
[Power Management]
Design of three-phase half-controlled rectifier circuit using PIC microcontroller chip
51 single chip microcomputer ------- digital tube (experimental report) [without 74HC753]
1. Experimental purpose: Experiment 3: Use the PO and P2 ports to realize the display effect of the digital tube from 0 to 7: (1) Master the method of programming microcontroller control programs using C language. (2) Master the methods of writing, compiling and debugging programs using Keil4 software. (3) Master the
[Microcontroller]
51 single chip microcomputer ------- digital tube (experimental report) [without 74HC753]
17-Low frequency signal generator based on 51 single chip microcomputer
Specific implementation functions The system consists of STC89C51/52+DAC0832 module+indicator and button module+LM358 module+LCD1602 display module+power supply module. 1. LCD1602 displays waveform type and frequency value (frequency range 10-100HZ); 2. You can set the waveform type and frequency step value by pre
[Microcontroller]
17-Low frequency signal generator based on 51 single chip microcomputer
ATmega16 MCU Bluetooth serial port control program
/*           HC-06 Bluetooth module ATmega16 microcontroller                  VCC----------------VCC         GND----------------GND         TXD----------------RXD (PD0 port, set input)         RXD----------------TXD (PD1 port, set output)          */ /*ICCAVR7.2 programming software*/ /*Use internal 8M crystal osci
[Microcontroller]
51 single-chip programmable chip 8255 LED light control
Programming steps: 1. Set the 8255 working mode (PA works in mode 0 and is input, PB works in mode 0 and is output) 2. Encode PA, PB port address (PA is #0FF7CH, PB is #0FF7DH, control port is #0FF7FH)​ 3. Layout circuit diagram (see Figure 1) 4. Design program (see source program notes) 5. Debugging simulatio
[Microcontroller]
Detailed analysis of the communication principle of single-chip multi-machine system
  1 Introduction   In measurement and control systems and engineering applications, it is often necessary to perform multiple tasks at the same time. Therefore, the master-slave multi-machine distributed system of the switching power supply module has become a widely used model in modern industry. Most of them are c
[Microcontroller]
Detailed analysis of the communication principle of single-chip multi-machine system
Design of Interface between ARINC429 Aviation Bus and AT89C52 Microcontroller
1 Main functions of DEI1016 DEI1016 is a serial receiving and transmitting device produced by DeviceEngineeringIncorporated that supports the ARINC429 aviation bus protocol. The main functions of this device are as follows: ●Serial data word length is 32 or 25 bits; ●Serial data rate is 100kbps or 1
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号