Design of Intelligent Vehicle Instrument Based on WinCE

Publisher:未来画家Latest update time:2011-04-20 Source: 单片机与嵌入式系统 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

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 sensors , and the instrument system obtains the current state of the vehicle through the sensors' analog quantities, which is not very accurate. The intelligent vehicle instrument designed in this paper is not simply connected to the sensor, but connects the entire vehicle into a network structure through the CAN controller. The vehicle components are equipped with CAN controllers, and the vehicle components are connected through twisted pair cables to form a network system to realize the electrification of the components. At the same time, the electrification of vehicle instruments and vehicle components also improves the accuracy and reliability of the vehicle and reduces the failure rate.

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.

System hardware structure

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.

CAN bus interface circuit

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 switching power supply module with multiple 5 V isolated outputs. Although these parts increase the complexity of the interface circuit, they improve the stability and safety of the node.

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:

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.

Driver Process

Conclusion

At present, vehicle-mounted instruments based on embedded technology are gradually becoming popular. This article uses the ARM9 microprocessor based on WinCE as a development platform, which has fast processing speed and powerful functions; uses CAN bus technology for mutual transmission of signals, and the CAN bus receives information sent by automotive components in real time, and processes and analyzes it; uses WinCE operating system, which has a friendly interface. This intelligent vehicle-mounted instrument system can save costs, reduce power consumption, and has strong maintainability and is easy to expand and upgrade.

Reference address:Design of Intelligent Vehicle Instrument Based on WinCE

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

S3C2440A serial port driver - Data communication between serial port and peripherals under WINCE6.0 (I)
1. Development Environment Write serial port driver under WINCE6.0, use UART0 of S3C2440A to communicate with PC, and UART1, UART2 to communicate with AVR Atemga162 microcontroller. 2. Serial stream driver process Mainly complete XXX_Init, XXX_Open, XXX_Read, XXX_Write, XXX_Seek, XXX_PowerUp, XXX_PowerDown, XXX_Clos
[Microcontroller]
Driver design of nRF24L01 under ARM and WinCE6.0
introduction nRF24L01 is a single-chip wireless transceiver chip that works in the 2.4-2.5 GHz universal ISM frequency band. It is used in wireless data communications, wireless access control, remote sensing, industrial sensors and toys. With the development of measurement and control technology, there ar
[Microcontroller]
Driver design of nRF24L01 under ARM and WinCE6.0
Latest Automotive Electronics Articles
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号