Automobile Intelligent Combination Instrument Based on LPC2292

Publisher:初入茅庐Latest update time:2012-08-27 Source: 微计算机信息 Keywords:LPC2292 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

The car instrument is the window and interface for information exchange between the driver and the car. It plays an active and important role in improving the service life of the car instrument and ensuring safe and economical driving. This design uses the LPC2292 embedded controller [1] as the control core of the instrument. The original sensors of the car do not need to be replaced. The output signals of the sensors are sent to the MCU through the signal conditioning circuit. The signals processed by the MCU are displayed on the LCD display. The vehicle speed, engine speed, water temperature, oil level, total mileage, sub-mileage and other vehicle condition parameters are displayed in real time, and the information is processed in a complex way to provide the driver with useful information such as average speed, economic fuel consumption, and remaining fuel mileage. At the same time, it can also record and store instantaneous driving information to realize the "black box" function; it can realize voice alarm prompts for abnormal situations, and reserve communication interfaces for future function expansion. Compared with traditional car instruments, this instrument has the advantages of rich functions, high reliability, high precision, good visibility, strong versatility, storage function, no mechanical wear, and long service life.

With the networking of automotive electronics, CAN bus technology has been more and more widely used in the automotive field. Therefore, CAN bus and embedded systems have become the inevitable trend of the future development of automotive instruments.

1 Basic structure and function of automobile instrument

The intelligent instrument of the car collects various status information of the vehicle, including vehicle speed, total and sub-mileage, engine speed, front and rear axle pressure, water temperature, oil volume, oil pressure, battery voltage, indoor and outdoor temperature, etc. Some of the information (vehicle speed, speed, and air pressure) is processed and sent to the stepper motor drive module to drive the pointer. The change of this information is faster than other information and is closely related to the driving safety of the vehicle. The display of this information with a pointer is intuitive, eye-catching, and in line with people's visual habits. Therefore, there are four commonly used indicator instruments in the car, namely the speedometer, engine tachometer, and barometer. They respectively display the vehicle's driving speed, single mileage and total mileage, engine rotation speed when the car is driving, and front and rear axle pressure. Other information that changes slowly (battery voltage, oil volume, etc.) is displayed on the LCD screen through data processing and LCD control modules.

The automotive intelligent instrument is composed of sensors, signal conditioning circuits, microcontrollers, keyboard input modules, stepper motor drive modules, voice alarm circuits, LCD displays, etc. Its principle block diagram is shown in Figure 1:

Figure 1 Schematic diagram of automotive smart meter

The microcontroller used in the system is the LPC2292 chip from PHILIPS. The LPC2292 is a microcontroller based on a 16/32-bit ARM7TDMI-S CPU that supports real-time simulation and tracing. It has 128KB on-chip Flash program memory; external 8, 16 or 32-bit bus; 4-channel 10-bit A/D converters with a conversion time as low as 2.44us; 2 interconnected CAN bus interfaces; 2 32-bit timers (with 4 capture and 4 comparison channels), PWM unit (6 outputs), real-time clock and watchdog; multiple serial ports, including 2 16C550 industrial standard UARTs, high-speed I2C interface (400Hkz) and 2 SPI interfaces; the maximum CPU operating frequency of 60MHz can be achieved through the on-chip PLL.

Among them: the vehicle speed sensor and conditioning circuit module [3] includes a photoelectric vehicle speed sensor and a signal conditioning resistor for the vehicle speed measurement channel. The vehicle speed sensor converts the vehicle speed corresponding to 0 to 200 km/h into a pulse signal with a frequency range of 0 to 136.3 Hz; the speed sensor and conditioning circuit module includes a pulse signal speed sensor and a signal conditioning circuit for the engine speed measurement channel. The speed sensor converts the engine speed corresponding to 0 to 8000 rpm into a frequency signal of 0 to 260 Hz; since the vehicle speed and engine speed sensors output pulse frequency signals, the corresponding signal conditioning circuit is used to shape, clamp/limit the output signal of the sensor to meet the MCU's requirements for the input signal. The temperature sensor uses a thermistor temperature sensor to measure the temperature of the car's cooling water. The sensor converts the change in water temperature into a change in resistance and voltage. The liquid level sensor uses a float-variable resistor liquid level sensor to convert the change in oil level into a change in resistance and voltage. The water temperature and oil level sensors output analog signals, and their corresponding signal conditioning circuits are resistor transmission networks, which send the output signals of the sensors to the A/D input terminals of the LPC2292. The E2PROM uses the 93LC46B three-wire serial electrically erasable programmable read-only memory, which has a capacity of 1K×16 bits, an erase cycle of 1M times, a display speed of 2ms, and a data retention time of up to 40 years. It is used in the instrument to save sub-mileage, total mileage data, and current vehicle conditions, and ensure that the data will not disappear when the power is off, playing the role of a "black box" for the car.

The stepper motor module drives and controls the speedometer, tachometer, front axle air pressure gauge and rear axle air pressure gauge.

The voice module is mainly used to store all alarm languages ​​and drive the alarm horn. When parameters such as vehicle speed, engine speed, water temperature and oil level exceed the limit, it will play a voice prompt alarm role.

The keyboard module is used for human-computer interaction, receiving input to change the instrument's operating parameters, instrument date and time settings, Chinese and English language switching, mileage reset and display screen switching.

The LCD display screen displays vehicle speed, engine speed, water temperature, oil temperature, total mileage, sub-mileage, date and time, battery voltage, various alarm indicators, interior temperature, exterior temperature and other vehicle condition parameters in real time.

The CAN communication module is composed of the built-in CAN controller of LPC2292 and the independent CAN transceiver PCA82C50. PCA82C50 is a high-speed CAN transceiver produced by Philips and can adapt to different CAN bus transmission rates.

2 Advantages of CAN bus and its application in the automotive field[2]

Controller Area Network (CAN) is a serial data communication protocol developed by Bosh in Germany in the early 1980s to solve the data exchange between numerous control and test instruments in modern automobiles. It is a multi-master bus whose communication medium can be twisted pair, coaxial cable or optical fiber. In the field of automation electronics, such as automotive engine control components, sensors, anti-skid systems, etc., the bus bit rate can reach up to 1Mbit/s. CAN networks are being continuously applied in various aspects of automotive electronics. The CAN bus has the following main features: (1) Multiple master stations access the bus based on priority; (2) Non-destructive bus arbitration based on priority competition; (3) Multi-address frame transmission with the help of receive filtering; (4) Remote data request; (5) Configuration flexibility; (6) Full system data compatibility; (7) Error detection and error instructions; (8) Automatic retransmission of frames that lose arbitration or are damaged due to errors during transmission.

3 Software Design

The automobile instrument cluster based on µC/OS-II uses the open source µC/OS-II as the application development platform. It mainly realizes the following functions: displaying engine speed, vehicle speed, front axle pressure gauge, and rear axle pressure gauge through the motor pointer; displaying vehicle speed, engine speed, water temperature, oil level, total mileage, sub-mileage and other vehicle condition parameters through the LCD screen. [page]

µC/OS-II is a completely free, open source, portable, and customizable preemptive multitasking embedded real-time operating system kernel. It is fully functional, reliable, compact, and has basic RTOS kernel service functions such as multitasking scheduling, inter-task communication and synchronization such as semaphores, mailboxes, and message queues, time management, and simple memory management. It uses a priority-driven preemptive multitasking scheduling algorithm [4].

According to the previous functional description of the entire system, the application can be divided into 6 tasks plus 6 interrupts (RTI beat interrupt belongs to system interrupt, and the other 5 are user interrupts). These 6 tasks are:

(1) Alarm display tasks: front and rear lights, brakes, power, fuel level, oil temperature, water temperature and other LED alarms;

(2) Mileage display and storage tasks: LCD displays vehicle speed, engine speed, water temperature, oil temperature, total mileage, sub-mileage and other vehicle condition parameters;

(3) Stepper motor 1 task: speed pointer display;

(4) Stepper motor 2 task: speedometer display;

(5) Stepper motor 3 task: front axle air pressure pointer display;

(6) Stepper motor 4 task: rear axle air pressure pointer display.

Each task is assigned a priority when it is created (ranging from 0 to 63, 0 is the highest and 63 is the lowest). The priorities of these six tasks are assigned as 1, 2, 3, 4, 5, and 6 in turn; the alarm task requires a timely response and has the highest priority; while the mileage display and storage tasks have the lowest priority. A higher priority task must call at least one system service and temporarily give up the right to use the CPU, otherwise the low priority task cannot be run.

The general structure of the task is as follows:

void UserTask (void *pdata)

{ for(;;)

{Call some system service of µC/OS II:

OSMboxPend ( )/OSMboxPost ( ); (1)

OSQPend ( )/OSQPost ( ); (2)

OSSemPend ( )/OSSemPend ( ): (3)

OSTaskDel (OS PRIG SELF); (4)

OSTaskSuspend (OS_PR_OSELF); (5)

OSTimeDly( )/OSTimeDlyHMSM(); (6)

}}

(1)-(6) are some major system service functions. These functions perform a task scheduling or may cause the current task to give up the right to use the CPU and run other tasks. A user task must call at least one service function.

In addition, the program has 5 user interrupt service routines written in C language: one CAN receive interrupt (for receiving bus information) and 4 timer output compare interrupts (for generating periodic pulses to drive the stepper motor).

Therefore, this example program can be planned as follows: first, call OSInit() to initialize µC/OS-II, then create a semaphore, because the following tasks will use the Printp() function, and Printp() is a non-reentrant function. Before calling it, it is necessary to prevent multiple tasks from calling it at the same time. This semaphore is used to protect the Printp() function. Then create 6 tasks and assign priorities to these 6 tasks. Finally, call OSStart() to start the kernel, so that the tasks run and switch under the management and scheduling of the operating system. Figure 2 is a brief flowchart of the program.


Figure 2 Program flow chart

4 Conclusion

With the busification of automobile electrical systems, high integration, embedded and busification are the inevitable trends in the development of automobile instruments. The intelligent combination instrument based on LPC2292 can display and save vehicle speed, engine speed, water temperature, oil level, total mileage, sub-mileage and other vehicle condition parameters in real time, making the car have a "black box" function. In addition, the CAN bus is used to establish a communication network, integrating vehicle instruments, video monitoring and voice output, solving the defects of inconvenient separate installation and poor reliability, and improving the reliability of the system.

Keywords:LPC2292 Reference address:Automobile Intelligent Combination Instrument Based on LPC2292

Previous article:Design of Injection Molding Machine Controller Based on LPC2138
Next article:Design of parallel acquisition interface between AD7656 and LPC2210

Recommended ReadingLatest update time:2024-11-16 21:49

Design of CAN bus intelligent node based on LPC2292
Introduction CAN (Controller Area Network) bus controller area network was first proposed by RoberBosch at the SAE conference in February 1986. CAN bus is a serial communication protocol that can effectively support distributed real-time control with a high level of security. Its original purpose was to be
[Industrial Control]
Design of CAN bus intelligent node based on LPC2292
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号