CAN bus automotive instrument with the total process
Introduction: With the rapid development of automobile industry, manufacturing industry in the leading position of our country more and more evident. To further increase the degree of domestic automobile production, as the core technology of autonomous cars property rights mentioned on the urgent development of China's automotive strategic agenda. With CAN Bus vehicle instrument system is based on this concept, to meet the current trends, many domestic automobile manufacturers in the urgent attention, as one of China's automobile industry's own starting point Kejihanliang technology R & D out of intellectual property. The special advantages of the electronic system first, it will simulate the previous combination of separate instruments each type of unified management of digital up. To improve the instrument's stability, accuracy, improving meter life while significantly reducing manufacturing costs; Second, it is to introduce the instrument in the automotive CAN bus, the system was designed to open, Yi embedded in the structure, leads to reduce the system to improve the system, while anti-jamming, greatly increased the flow of data within the system, Yasumasa the vehicle instrument in real time. Simplifies the instrumentation system and the vehicle central control center interface.
Have developed out of the sets of electronic instrumentation systems, not tightly filled Woguo vehicle instrument without all Shuzi of the Kongbai, while it Yeshi a country with a wide range of market price, Kechixuxing Fazhan business projects.
Car Instrument System parameters and hardware to handle the work of Block Diagram
A vehicle instrument system to handle and display of parameters
The instrument system is placed in the driver and steering wheel before, the main focus is to provide drivers of vehicles traveling the road conditions.
In this situation the vehicle described as a series of parameters. This is one of these parameters required to gauge needles in the form of real-time instructions to the driver, some other parameters in real time in digital form to be displayed to the driver.
The instrument system designed as a general dial. Should always dial needle indication of the main parameters are: 1) engine cooling water temperature, 2) tank of fuel, 3) engine speed, 4) vehicle speed real-time exercise.
Instrument panel liquid crystal display parameters should include: 1) engine speed, 2) vehicle speed real-time exercise, 3) the total length of travel time and car dealers (the film liquid crystal film data can be displayed on the flip). Circuit at the same time maximum 16-bit LCD digital tube light, in addition to the instrument panel also need the light to its vehicles, turn signals, instrument panel backlight display lights.
The main work of the instrument system, the task is: the temperature sensor through the car engine cooling water temperature, through the oil will float or magnetic switch sensor in the remaining oil fuel tanks, high-speed, low-speed Hall sensor and vehicle speed internal combustion engine Real-time vehicle speed is converted to pulse period to exercise, after CPU's A / D conversion processing and pulse-width capture CCP were handled in the four stepper motor drive with four gauge needles, real-time instructions to truck driver, and engine speed , vehicle speed, vehicle mileage, three parameters will have to be LCD digital control can be digitally displayed. In addition, the car door control lights, turn left and right, front and rear drive, and the brake lights, when the ambient light after dark under the dashboard to turn the backlight brake lights, LED tubes have to be in the form of reaction to the instrument panel. In addition, the system needs to periodically record and back up a road mileage to the serial memory.
Second, the hardware circuit-board instrumentation system working principle and schematic
Selection of the microcontroller of the system center is produced by the U.S. industrial MICROCHIP PIC18F458. It can be said, PIC18F458 is a system for vehicle instrument custom tailored SCM. Although the CPU PIC18F458 8-bit external interface, but the core bus structure is indeed 16-bit. Accurate to say that is a standard 16-bit PIC18F458 microcontroller, which both have a simple interface features 8-bit microcontroller with 16-bit microcontroller at the same time it's computing power. The MCU instruction set using pipelining instruction, and the internal integration of the 8-bit hardware multiplier, which is why SCM fast speed, CPU strong low-end PIC MCU up their lack of computing power. And I / O port of the drive current is greater than 2mA, can be directly used to drive the digital control, CPU chip with a carrying capacity of highly. In addition to the microcontroller can be 8, 10 precision A / D conversion. Which SCM procedures and data storage structure is different than the conventional single chip, the design of its space are particularly large, overall, there are 2M 4K of data memory and program memory space, memory space Hafor structure of data space and procedures can be individually addressable space. 4K of data on the memory management is concerned, is divided into 16 pages, each page is 256 bytes. 2M of the program memory space management, similar to 8088/8086, 2M of the program memory space management, divided into two parts of the stack and the physical address (because of space here does not expand narrative). This single chip memory management features are great, do so because, not only to increase memory space, more importantly, beneficial to the embedded operating system migration. On this single chip, the more popular systems such as those currently used for commercial embedded operating system you do not need external expansion memory chips.
Which microcontroller design for automotive instrumentation, which includes a general 16-bit microcontroller cores contained in the same time, it also encapsulated within a 256-byte serial memory can be erased electricity. While the memory use of SOC package, and CPU core encapsulated in the same chip, but still use I2C bus interface, a way. The instrumentation system design, because of the needs of foreign expansion of a serial FLASH memory 24LC01, to record some of the more important vehicle information. I2C-bus with a way to write data to the 24LC01 can also mirror copy of data to the CPU chip's serial memory, so you can protect important data in duplicate, one in the CPU, the one in the CPU, . This not only prevents loss of important data, but also to prevent man-made vehicle information data is bogus. The following is divided into five sub-graph profile of the vehicle instrument electronic system works and concrete realization of the circuit.
1) CPU MCU PIC18F458 application of principle of the system diagram and wiring diagram
Figure 1 CPU MCU PIC18F458 application system wiring diagram:
CAN bus automotive instrument with the total process
(Figure 1)
Note: CCP1 capture the pulse width of the device, ECCP1 for the enhanced pulse width of the catcher
Figure 1 works for the CPU and system circuit, the circuit system is composed of seven single chip U1, and circuit module. The system adopts the single chip is the PIC18F458, DIP package, 40 pins. U1 chart from the marking can be more intuitive, great to see the U1 chip to the pin functions. Seven modules are: a four meter stepper motor control module, two, two-pulse signal capture module, 3, liquid crystal display module, 4, CAN transceiver driver module, five extension modules keyboard instrument, six, signal lights control module, 7, A / D converter control module. System also extends a 24LC01B, FLASH serial memory, the serial memory is connected through the I2C bus and CPU, used to record the identity of the car, driving the total mileage. Q1 figure is the STO-23 package, the MCU power recovery module.
Instrumentation stepper motor control module is used for driving the company MOTOROALTER pointer instrument specifically designed for stepper motor chip XI2027. The chip set with a strong ability to simultaneously drive the four stepper motor with a meter pointer. Use it to drive the system shows the speed of the stepper motor vehicle; shows the stepper motor vehicle engine speed; show the cooling water temperature of the stepping motor vehicle; show car carriage stepper motor oil level.
Two pulse-width signal capture module is central to the work of the electronic system. Vehicle speed and vehicle speed is the engine instrument system on the vehicle speed to indicate to the parameters. Select PIC18F458 one of the reasons for the control center of the pulse signal microcontroller with Èr traps, all the way for the general pulse-width signal capture device CCP1, another way to enhance high-speed pulse signal capture device ECCP1, this system is very good The advantage of this feature of PIC18F458 microcontroller, through the application of Hall sensor, measured with CCP1 slower rotation speed of vehicles; with ECCP1 measuring rotational speed of a faster car engine of the vehicle speed, engine speed and the stepping motor vehicle driven instruments corresponding display.
LCD module is used in the company's HT1621B PHILIPS LCD driver chip, the chip can simultaneously drive eight LCD digital control.
System than the traditional instrument is the introduction of advanced CAN bus architecture, select PIC18F458 as the control center of the second reason is that the microcontroller integrates a CAN controller. Select PIC18F458, which has raised the technical content of electronic instrumentation systems, while significantly saving microcontroller peripheral interface circuits, microcontroller peripherals just extended CAN driver circuit without complex control circuits. The electronic system can work independently from the CAN bus.
Select PIC18F458 as the control center of the third reason is that the microcontroller has 8 10 precision A / D conversion interface. Particular mention is the way by measuring the tank level sensor A / D conversion, the other road vehicles through the cooling water temperature sensor A / D conversion. In addition to light intensity and so on.
To save MCU I / O resources, the system keyboard extension decoding method used to expand the 74LS148 decoder chip. Signal control module used to drive the car dealers blinkers, the display backlight control.
2) stepper motor control module and wiring diagram works
The instrument panel on the use of the motor is SWATCH produced MS MOTOR. The compact motor design, simple structure, inexpensive, can be applied to a variety of instruments occasions, is the extensive use of cross cross-coil meter motor alternatives. Its structure can be found in the manual SWATCH. Principle: The electric motor rotor consists of two parallel drive with a magnet coil center, the interface circuit on the marked Stepmotor, stepper motor interfaces. Pulse drive coil drive motor rotor rotation, each pulse sequence through a driver, motor rotor to turn 600, a total transmission ratio is 1:180, that is, each through a pulse sequence, the pointer rotating 1 / 30. MS MOTOR stepping motor coil drive current only 20mA, low energy consumption.
Figure 2 Instrumentation System Motor Driver Interface circuit:
(Figure 2 cars with CAN-bus trip meter total)
The instrument system used in the motor drive module shown in Figure 2. Chip U4 X12027. U4 X12027 is MOTOROALTER company for driving stepper motor pointer instrument designed ASIC. The chip family of four, with a single motor drive, drive two motors and drives in four, eight motor. X12027 can also drive the four stepper motor. Greatly simplifies the use of the chip stepper motor and the CPU interface and control circuitry. To see from the chart, STEPMOTO the four motors and chip interface 1A, 2A, 3A, 4A, 1B, 2B, 3B, 4B, 1C, 2C, 3C, 4C, 1D, 2D, 3D, 4D. FA, FB, FC, FD can control the motor direction of rotation of four; ORIENT control is required to turn the motor steps; RESET control, removed and updated electrical real-time, number of steps required to turn.
3) display module, keyboard module works and wiring diagram
The instrument system used in the display module driving circuit shown in Figure 3. PHILIPS chip U2 HT1621B is the company code segment for LCD displays designed for special driver chips, HT1621B can drive 16 yards by 8-bit LCD segment. Chip U6 NNPRLCD is LCD chip, chip in NNPRLCD LCD can display 16 8 yards. On the circuit diagram is shown in U2 HT1621B and U6 NNPRLCD connection. Figure in CS as U2's chip select pin, active-high; HT1621B through the SPI bus and the CPU interface; data downloaded through the SPI bus to HT1621B display buffer for display and brake by the HT1621B refresh, do not take up CPU time . WR for the LCD display latches "write" control side, active-low.
Keyboard circuit, as shown in Figure 4, due to system resources CPU I / O port shortage, the instrumentation system uses the method of decoding circuit is extended keyboard. Figure 4 U8 74LS148 8-3 coding for the chips. Systems still use the software check issued through the side, 15 feet high to the U8 to check through U8 5 feet, such as a low level, key enter a valid "read" key.
Figure 4 Figure keyboard module interface circuit:
CAN bus automotive instrument with the total process
(Figure 4)
4) CAN communication module works and wiring diagram
The selection of the microcontroller system is produced by the U.S. industrial MICROCHIP PIC18F458, addition to the various advantages of the CPU, this instrument system selected PIC18F458 microcontroller as the core control unit to another more important reason is that the microcontroller integrates a compatible BUSH1.0 CAN protocol controller and BUSH2.0 agreement.
As an advanced technology, high reliability, function well in a remote network control method, CAN-BUS has been widely used in the automatic control system, in the automotive electronics, CAN-BUS has been the vehicle as a Peugeot grade of a scale, the current CAN-BUS has been more widely used on high-end cars. The vehicle instrument electronic system, the open design of the guiding ideology, Zai Jian Rong to Yi Ban vehicles Suo Ying Yong the same time, the first Changdao application CAN-BUS control system, the virtue of providing significantly reduced the vehicle by using clues, lower the car failure rate.
Due to the internal PIC18F458 microcontroller integrated CAN controller, the meter system in the CAN network control circuit just outside the expansion of a chip U11A, CAN transceiver drive TJA1050, hardware completes the CAN-BUS interface functions. Savings, simplified circuit design, application very convenient. . Hardware, circuit 5, U9A 6N137, U10A 6N137 is optical isolation devices.
The vehicle electronic system can be used as an instrument independent CAN nodes used in the CAN-BUS automation control system can also be independent from the CAN-BUS car work. PIC18F458 Microcontroller own CAN transceiver interfaces, CAN module is relatively independent. Its main features are as follows:
By ISO CAN standard test, the standard frame and extended frame two kinds of modes 0-8-bit data length, programmable rate up to 1M bps, 2 items of data to receive buffer, 6 complete receiver filter, 2 corresponding to high priority buffer, 4 correspond to the low priority buffer, two full receiver mask device, three have priority send buffer.
CAN module can operate in six modes: configuration mode, disable mode, the normal operating mode, monitor mode, since the cyclic model, error recognition mode. The system involves two modes: configuration mode and normal mode.
First of all, the CAN in the configuration mode control and status registers, the baud rate control registers, I / O control registers, interrupt flags and interrupt control registers, the receiver filter mask and a receiver configured in accordance with the requirements of the system to ensure the CAN bus smooth. These registers can be configured in the configuration mode set after the system into normal mode. The instrument system can be used as a lower machine CAN CAN nodes used in vehicle control systems, wait for data from the CAN bus.
The instrumentation systems and vehicle control systems center CAN communication involves the physical layer, link layer and application layer:
Physical layer requirements: communication protocol compliance CAN2.0B.
Link layer requirements: communication protocol compliance CAN2.0B, and some reference J1939/21.
Application Layer: In this only gives 1. Hydraulic signal, 2. Speed signal, the second data frame.
1)
2) Speed signal:
Priority: 6
Bias: 0
Measurement range :0 ---- 250 .996 KM / H
Unity gain: 1/256KM/H
Transfer rate: 100MS
Data length: 8 bytes
Data page: 0
Device number: 2
PF: 255
PS: 1
PGN: 65281 (0XFF01)
1 - 2BYTE: speed
Hydraulic signals:
Priority: 6
Bias: 0
Measurement range :0 ---- 500KPA
Unity gain: 2KPA
Transfer rate: 1S
Data length: 8 bytes
Data page: 0
Device Number: 1
PF: 255
PS: 1
PGN: 65281 (0XFF01)
1BYTE: Hydraulic
2 - 8: reserved (0XFF) 2 - 8: reserved (0XFF)
Figure 5 Figure CAN communication module interfaces:
CAN bus automotive instrument with the total process
(Figure 5)
Car instrument system software works and Block Diagram
CPU PIC18F458 Although the external interface is 8-bit microcontroller, but it is 16-bit kernel, and can be called quasi 16-bit microcontroller. Instrumentation system complexity, program volume. Taking into account the continuity of programmers, program readability, program portability, software programs developed using C language. PIC18F458 MCU simulation system also supports the development of C language environments. Programming. Taking into account the instrument system business, sustainability, in order to increase system stability, the introduction of real time and follow-up work to be a reliable commercial embedded operating system. Software program used the method before and after the Taiwan incident. Front is the main loop process, the background is the interrupt handler. Prospects for data processing, the background data collection. By event programmatically, the background information to change the system, change the foreground according to background information to complete the entire instrument system real-time processing. Software system block diagram omitted for space reasons.