With the development of high-performance electronic display technology, the degree of electronicization of automobile instruments is getting higher and higher. High-tech products such as multifunctional all-electronic display instruments, head-up display instruments, car navigation systems, and driving recorders have been developed at home and abroad. In the future, electronic embedded instruments for automobiles will have the following advantages: providing a large amount of complex information, making the degree of electronic control of automobiles higher and higher; meeting the requirements of small and lightweight, making limited driving space more humane; realizing the electronicization of automobile instruments with high precision and high reliability, reducing the occurrence rate of failures; equipped with an online fault diagnosis system, once the car fails, the source of the fault can be found, which is convenient for maintenance; the appearance design has a high degree of freedom, and the automobile dashboard is beautiful. Based on the above advantages, more and more automobiles will adopt electronic instruments for various purposes. Embedded electronic instruments with novel shapes and powerful functions will be the development trend and trend of automotive instruments in the future.
1 Intelligent vehicle instrument system structure
The intelligent vehicle instrument has the functions of most traditional vehicle instruments. The driver can obtain the current vehicle status information, such as vehicle speed, oil pressure, oil temperature, water temperature, engine oil pressure or battery power, through the display interface of the vehicle instrument.
Traditional vehicle instruments are directly connected to the vehicle's
The vehicle-mounted intelligent instrument is mainly divided into two parts: the hardware system based on the S3C2440 processor and the software system under the WinCE environment. The hardware system provides the basis for the entire control system and is responsible for CAN bus communication. The software system provides the hardware driver of the CAN bus and the instrument upper application under WinCE.
2 Hardware Design
The hardware system is based on S3C2440, with RAM memory, NOR Flash and NAND Flash as storage media, and some peripheral devices are extended to be responsible for the input and output of system information, such as CAN bus communication unit, LCD display, touch screen, universal serial port, USB device, Ethernet interface, etc. The system hardware structure is shown in Figure 1.
Among many interfaces, the CAN bus communication unit is a key part in the whole vehicle communication process. In each important part of the car, a corresponding CAN control unit is configured, and each CAN bus control unit is connected by a twisted pair. Each part of the car sends the current status information of the part through the CAN control unit, which is sent to the CAN unit of the intelligent vehicle instrument through the twisted pair, and the data is sent to the system through the CAN interface of the system. After the vehicle instrument system obtains the data, it processes the data to obtain the current status information of the vehicle parts.
The CAN bus interface circuit is shown in Figure 2. The CAN bus controller MCP2515 from Microchip is used. MCP2515 fully supports the CAN 2.OA/B technical specification and has a speed of 1Mbps. The SPI interface standard makes it easier to connect to the S3C2440. It can send and receive standard and extended data frames and remote frames. It has 2 acceptance mask registers and 6 acceptance filter registers to filter out unwanted messages, reducing the microprocessor's overhead. The CAN bus transceiver uses TJA1050, which provides the interface between the CAN controller and the physical bus and the differential sending and receiving functions of the CAN bus.
In order to enhance the anti-interference ability of the CAN bus node and improve the stability of the system, an optocoupler isolator 6N137 is added between the CAN controller and the CAN transceiver, instead of connecting the TXCAN and RX-CAN terminals directly to the transceiver, so that the electrical isolation between the CAN nodes on the bus is achieved. At the same time, this also solves the problem of level compatibility between MCP2515 and TJA1050, and can also suppress spike pulses and noise interference in the CAN network. The two power supplies used in the optocoupler part of the circuit must be completely isolated, otherwise it will lose its meaning. The isolation of the power supply can be achieved by using a low-power power isolation module or a
At the CAN interface, the two 60Ω resistors (total 120Ω) on the CAN communication line play a role in increasing the load and reducing echo reflection, which is a remedial measure for impedance matching. A capacitor is connected between the middle part of the two 60Ω and the ground terminal to resist interference.
3 Software Design
The overall environment of the software is the winCE programming environment. The corresponding WinCE operating system is customized for the vehicle-mounted intelligent instrument hardware system to realize the hardware driver. Then the application is written to operate the system hardware through specific operations on the application, that is, to realize the system functions. Among them, writing the driver of the CAN controller is very critical. The CAN driver realizes the operation of the application software on the CAN control unit and reads the data code in the CAN control unit.
3.1 System development and migration
Embedded system development is the design of the system driver layer, the most important of which is the development and debugging of BSP. Therefore, the development of the underlying driver of smart vehicle instruments is particularly important.
Since the WinCE operating system is used , the WinCE operating system image is customized using Platform Builder. In Platform Builder, drivers for some system hardware (such as LCD screen, RAM) can be added. These drivers have been written by Microsoft. Then start the Bootloader, download the image file to the Flash memory, and configure the operating system startup file boot.ini.
3.2 CAN bus driver development
Since CAN is an external device, the CAN driver needs to be written as a stream interface driver. The stream interface driver function is designed to closely match the usual file system API (such as Activate Dev-iee, ReadFile, WriteFile, and IOControl, etc.), that is, the stream interface driver appears as a system file in the application, and the application completes the operation of the device by operating the special files of the system file. The writing of stream interface files mainly uses stream interface functions, which are the entry points of the stream interface driver, such as XXX_Init, XXX_Read, and XXX_Open. These stream interface files correspond to the corresponding API functions, so that the application can access the external device through the corresponding functions.
As a stream interface driver, the CAN bus driver also has a set of standard functions to complete I/O operations. These functions are provided to the WinCE operating system kernel, and they are all DLL files of the stream interface driver. When dynamically loading the CAN bus driver, the system must register it. CAN driver registry information:
After completing the registration through the above code, call the ActivateDeviceEx() function to load the driver.
3.3 CAN bus driver communication process
The CAN bus controller driver is mainly used to set the baud rate of MCP2515, the acceptance filter of MCP2515, the CAN message transmission mode and the CAN data transmission and reception mode. The driver is an intermediate link between the upper application and the hardware. The intelligent vehicle instrument system is developed in the EVC++ environment.
The stream driver opens the function CreateFile() as a file: After the driver is successfully opened, the CreateFile() function returns a handle that is not INVALID-HAN-DLE-VALUE, which is also the parameter of the driver closing function Close-Handle(). The CAN setting function DeviceIoControl() receives the handle and control command code obtained by the CreateFile() function, sets the input/output buffer and the size of the buffer. After the function is executed, it returns the actual output buffer size, etc. The CAN bus sending and receiving functions WriteFile() and ReadFile() use the driver file handle, send and receive buffer and other parameters to complete the sending and receiving of data, and return the number of bytes actually sent and received after the operation is successful.
In order to prevent the main thread from being in a state of waiting for data to arrive and to allow the main thread to have a time token to operate other things, the program adopts a multi-threaded design and creates a data receiving thread. The data receiving thread is an infinite loop that continuously queries the CAN bus data exit flag. If the exit flag is valid, the loop ends and exits. The driver process is shown in Figure 3.
Conclusion
At present, vehicle-mounted instruments based on embedded technology are gradually becoming popular. This article uses the ARM9
Previous article:Design and implementation of automotive BCM based on MC9S12XS128
Next article:Car dashboards: time for a change
Recommended ReadingLatest update time:2024-11-16 19:26
- Popular Resources
- Popular amplifiers
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Knowledge about electromagnetic radiation
- A33 development board has a strange problem, I hope experts can give me some advice! Thank you!
- AD20 is significantly faster than AD19
- Design of Ethernet physical layer chip clock synchronization PLL
- si514 programmable oscillator debugging, with engineering source code
- Two new TI boards
- GD32 loopback mode CAN_TX pin cannot detect data
- [Chuanglong TL570x-EVM] Use the new version of Prossessor SDK and create a working environment
- Our country has developed a beautiful robot... Would you buy one?
- LM5161-Q1 Fly-Buck Reference Design