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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- Importance of testing mobile phone lithium batteries, screens, and cameras from the perspective of mobile phone configuration
- Learn about the MSP430F5438A interrupt system
- Ask about EG8010 comparator positive feedback
- Topology Selection of Bidirectional DCDC Converter
- [Second Batch of Shortlist] 2022 Digi-Key Innovation Design Competition
- Will MakeCode support Python?
- What are the specific differences between triodes and MOS tubes?
- Teach you how to design an accurate and thermally efficient wearable body temperature detection system?
- SimpleLink Ultra-Low-Power Wireless MCU for Bluetooth Smart Applications
- CC2540 Bluetooth Low Energy USB Dongle Reference Design