Current location - Education and Training Encyclopedia - Graduation thesis - Design of automobile taillight controller based on FPGA
Design of automobile taillight controller based on FPGA
1. 1 design purpose

The purpose of this design is to deeply understand the principle of computer composition, EDA technology [2] and master the design method and thought of VHDL hardware description language through practice. Guided by the principle of computer composition, VHDL language is combined with the theory of electronic circuit design knowledge to master the course knowledge and the comprehensive design application of basic unit circuits. Through the design of the actual automobile taillight controller [3], we can consolidate and comprehensively apply the learned knowledge, improve the IC design ability, and improve the independent working ability of computer technology analysis and solving practical problems.

The basic content of 1.2 design

According to the principle of state machine in computer, the module of automobile taillight controller is designed with VHDL language, and the module is simulated and verified with EDA tools. The design of automobile taillight controller is divided into four modules: clock frequency division module, automobile taillight master control module, left light control module and right light control module. After integrating each module, the automobile taillight controller is formed. By inputting the system clock signal and the related automobile control signal, the automobile taillight will correctly display the current automobile control state.

Introduction to 1.3 EDA

The concept of 1.3. 1 EDA technology

EDA (Electronic Design Automation) is the abbreviation of Electronic Design Automation, which developed from the concepts of Computer Aided Design (CAD), Computer Aided Manufacturing (CAM), Computer Aided Testing (CAT) and Computer Aided Engineering (CAE) in the early 1990s. EDA technology uses computer as a tool. On the EDA software platform, designers use the hardware description language HDL to complete the design files, and then the computer automatically completes the logic compilation, simplification, segmentation, synthesis, optimization, layout, routing and simulation until the adaptive compilation, logic mapping and programming download for a specific target chip.

Characteristics of 1.3.2 EDA technology

Using EDA technology to design electronic system has the following characteristics: ① designing hardware with software; (2) The conversion from a software-designed system to a hardware system is automatically completed by relevant development software; (3) In the design process, various simulations can be carried out through relevant software; ④ The system can be programmed on site and upgraded online; ⑤ The whole system can be integrated on one chip with small volume, low power consumption and high reliability. Therefore, EDA technology is the development trend of modern electronic design.

1.3.3 EDA design process

The typical EDA design process is as follows:

1, text/schematic editing and modification. Firstly, the designer's design intention is expressed in text or graphics by using the text or graphic editor of EDA tool.

2. compile. After the design description is completed, it can be debugged and compiled by a compiler and turned into a specific text format to prepare for the next synthesis.

3. synthesis. Linking software design with hardware implementation is the key step to transform software into hardware circuit.

4. Behavior simulation and function simulation. The generated netlist file is used for functional simulation to understand the consistency between design description and design intent.

5. adaptation. Using FPGA/CPLD layout adapter, the synthesized netlist file is logically mapped to specific target devices, including bottom device configuration, logic division, logic optimization and layout. The adaptation report indicates the Boolean equation description of resource allocation and utilization, pin locking and design in the chip.

6. Functional simulation and time sequence simulation.

7. download. If no problems are found in all the above processes, the download file generated by the adapter can be loaded into the target chip through the FPGA/CPLD download line.

8. Hardware simulation and testing.

1.4 Hardware Description Language (VHDL)

Introduction to 1.4. 1 VHDL

VHDL (Very High Speed Integrated Circuit Hardware Description Language) is mainly used to describe the structure, behavior, functions and interfaces of digital systems. Except for many sentences with hardware features, the language form, description style and grammar of VHDL are very similar to those of general computer high-level languages. The program structure of VHDL is characterized by dividing an engineering design or design entity (which can be a component, a circuit module or a system) into external (or components and ports) and internal (or invisible parts), which involves both the internal functions of the entity and the algorithm completion part. After defining the external interface of a design entity, once its internal development is completed, other designs can directly call this entity. This concept of dividing design entities into internal and external parts is the basis of VHDL system design.

Characteristics of 1.4.2 VHDL language

1. Using VHDL code to design instead of schematic diagram means that the model and performance of the whole circuit board can be verified by computer simulation.

2.2 design. VHDL component has nothing to do with process, and is independent of process, which is convenient for process conversion.

3.VHDL supports various design methods, top-down, bottom-up or mixed.

4. It can be described from system level to logic level, that is, mixed description.

5.VHDL is different from other HDL, and has formed a standard, and its code can be exchanged in different systems for modeling.

2. Overall design

2. 1 demand analysis

According to modern traffic rules, the taillight controller should meet the following basic requirements:

1. When the car is in normal use, the indicator light goes out.

When the car turns right, a light on the right comes on.

When the car turned left, a light on the left side came on.

When the car brakes, the left and right indicator lights are on at the same time.

When the car is driving at night, the left and right indicator lights are always on.

2.2 Working principle of automobile taillight controller

The taillight controller is an example of a state machine. When the car is driving normally, the indicator lights are all off; When the car turns right, the indicator light RD 1 on the right side of the car lights up; When the car turns left, the indicator light LD 1 on the left side of the car is on; When the car brakes, the right indicator lamp RD2 and the left indicator lamp LD2 of the car are on at the same time; When the car is driving at night, the indicator light RD3 on the right side of the car and the indicator light LD3 on the left side of the car are always on. By setting the input signals of the system: system clock signal CLK, vehicle LEFT turn control signal LEFT, vehicle RIGHT turn control signal RIGHT, BRAKE signal BRAKE, night driving signal and system output signals: three indicator lights LD 1, LD2, LD3 on the left side of the vehicle and three indicator lights RD 1, RD2 on the right side of the vehicle,

RD3 has achieved the above functions. The overall assembly design principle of the system is shown in Figure 3. 1.

Figure 2.3 Design principle of integral assembly

2.3 automobile running state table and overall block diagram

See table 1 for the automobile taillights and the automobile driving state table.

Automobile taillights and automobile running state table 1- 1

The switch controls the running state of the car, the right turn signal and the left turn signal.

s0 s 1 S2 r 1 r2r 3 l 1l2l 3

0 0 0 Normal operation light goes out.

0 0 1 the left turn signal is turned off and turned on in the order of L 1L2L3.

0 1 0 turn right and turn on the lights in the order of R 1R2R3.

0 1 1 Temporary braking/detection All taillights are on at the same time.

100 When reversing, all the taillights will light up in turn.

1 0 1 R3 and L3 are always on when driving at night.

The overall block diagram of automobile taillight control circuit design is shown in figure 1:

Figure 1 Overall block diagram of automobile taillight control circuit design.

3. Detailed design

3. 1 each component module

The main function is to realize the lighting mode of automobile taillights through switch control. The automobile taillight controller consists of four modules, namely, clock frequency division module, automobile taillight master control module, left light control module and right light control module. The detailed design of each module is introduced below.

3.2 Clock Frequency Division Module

The working block diagram of the whole clock frequency division module is shown in Figure 3.2.

Figure 3.2 Working Block Diagram of Clock Frequency Division Module

The clock frequency division module is realized by VHDL program, and the following is a VHDL code:

The architectural art of Shenzhen is

Signal count: STD _ logic _ vector (7 down to 0);

begin

Flow (CLK)

begin

If the CLK event and CLK =' 1' then

Count & lt = count+1;

End if;

End the process;

CP & lt= COUNT(3);

End art;

3.3 Main Control Module of Automobile Taillight

The working block diagram of the main control module of automobile taillights is shown in Figure 3.3.

Figure 3.3 Working block diagram of main control module

The main control module of automobile taillight is realized by VHDL program, and the following is a VHDL code:

The CTRL of architectural art is

begin

Night _ led < = night;

Brake _ led < = baking;

Process (left, right)

The variable temp: STD _ logic _ vector (1downto0);

begin

Temperature: = left & right;

Shell temperature is

When "00" = >; LP & lt='0'; RP & lt='0'; LR & lt='0';

When "0 1" = >; LP & lt='0'; RP & lt=' 1'; LR & lt='0';

When "10" = > LP < ='1'; RP & lt='0'; LR & lt='0';

When others = & gtlp < =' 0'; RP & lt='0'; LR & lt=' 1';

Close the case;

End the process;

End art;

3.4 Left Lamp Control Module

The working block diagram of the left lighting control module is shown in Figure 3.4.

Figure 3.4 Working block diagram of left light control module

The left light control module is realized by VHDL program, and the following is a VHDL code:

The architectural art of LC is

begin

LEDB<= brake;

Ledn < = night;

Process (CLK, LP, LR)

begin

If the CLK event and CLK =' 1' then

If (LR ='0'), then

If (LP = '0') then

LEDL<='0';

other

LEDL<=' 1';

End if;

other

LEDL <='0';

End if;

End if;

End the process;

End art;

3.5 Right Light Control Module

The working block diagram of the right lighting control module is shown in Figure 3.5.

Figure 3.5 Working block diagram of right lighting control module

The right light control module is realized by VHDL program, and the following is a VHDL code:

The architectural art of RC is

begin

LEDB<= brake;

Ledn < = night;

Process (CLK, RP, LR)

begin

If the CLK event and CLK =' 1' then

If (LR = '0'), then

If (RP = '0'), then

LEDR <='0';

other

LEDR <= ' 1';

End if;

other

LEDR <='0';

End if;

End if;

End the process;

End art;

4. System simulation and debugging

4. Simulation and Analysis of1Frequency Division Module

After the frequency division module is implemented by VHDL program, its simulation diagram is shown in Figure 4. 1.

Figure 4. Simulation Diagram of1Frequency Division Module

Simulation analysis of simulation diagram: As shown in the figure, a 600ns clock pulse is generated at first, and the 600ns pulse is divided into a 40ns pulse by clock frequency division to realize signal synchronization.

4.2 Simulation Analysis of Main Control Module of Automobile Taillight

After the main control module of automobile taillight is realized by VHDL program, its simulation diagram is shown in Figure 4.2.

Figure 4.2 Timing Simulation Diagram of Master Control Module

Analysis of time series simulation diagram: right, left, night and brake are input signals, right means right turn, left means left turn, night means driving at night, and brake means braking. Rp, LP, night _ led and brake _ led are output signals. As shown in the figure: when the right is 1, a signal pulse with RP of 1 is generated; when the left is 1, a signal pulse with LP of 1 is generated; and when the night is 1, a signal pulse with NIGHT_LED of 1 is generated. When the brake is 1, a signal pulse output with BRAKE_LED as 1 will be generated.

4.3 Simulation Analysis of Left Lamp Control Module

After the left light control module is realized by VHDL program, its simulation diagram is shown in Figure 4.3 below.

Analysis of time series simulation diagram: LP, LR, night and brake are input signals, left-turn LP is 1, right-turn LR is 1, night driving is 1, brake is 1. LEDL, LEDB and LEDN are output signals, representing the three light areas on the left side of the car. As shown in the figure: when LP is 1, the output of LEDL is 1, indicating that the left light is on; When the brake is 1, the output of LEDB is 1, indicating that the left light is on; When the night is 1, the output of LEDN is 1, indicating that the left light is on. When LR is 1, the outputs of the three left light areas are all 0. That is, there is no light on.

Figure 4.3 Time sequence simulation diagram of left lamp control module

4.4 Simulation Analysis of Right Lamp Control Module

After the right light control module is realized by VHDL program, its simulation diagram is shown in Figure 4.4.

Figure 4.4 Timing Simulation Diagram of Right Lamp Control Module

Analysis of time series simulation diagram: RP, LR, Night and Brake are input signals, left-turn LR is 1, right-turn RP is 1, NIGHT is 1 driving at night, and BRAKE is 1 braking. LEDR, LEDB and LEDN are output signals indicating the three light zones on the right side of the car. As shown in the figure: when RP is 1, the output of LEDR is 1, indicating that the right light is on; When the brake is 1, the output of LEDB is 1, indicating that the right light is on; When it is 1 at night, the output of LEDN is 1, indicating that the right light is on. When LR is 1, the outputs of the three light areas on the right are all 0. That is, there is no light on.

4.5 Simulation and analysis of the whole system

The simulation diagram after assembling the system according to Figure 2.3 is shown in Figure 4.5 below.

Analysis of time series simulation diagram: right, left, night and brake are input signals, right means right turn, left means left turn, night means driving at night, and brake means braking. Rd 1, rd2 and rd3 are output signals, representing the three light areas on the right side of the car. Ld 1, ld2 and ld3 are output signals, indicating the three light areas on the left side of the car. As shown in the figure: when the right is 1, the output of RD 1 is 1, indicating that the right light is on; When the left is 1, the output of LD 1 indicates that the left light is on; When the night is 1, the outputs of LD 2 and RD2 are both 65438. When the brake is 1, the outputs of LD3 and RD3 are both 1, indicating that there is a light on the left and right sides.

Figure 4.5 Simulation diagram of the whole system

4.6 Overall Design Circuit Diagram

Figure 4.6 Overall Design Circuit Diagram

abstract

After two weeks of intense work, I finally completed my design task-the design of automobile taillight controller. Through the study of this course design, I deeply realized the importance and purpose of designing the course. This design course not only cultivates our practical operation ability, but also cultivates our ability to flexibly use textbook knowledge, integrate theory with practice and design independently. It is not only a good opportunity to learn new knowledge and new methods, but also a comprehensive test and review of what you have learned, so that you can understand your own shortcomings and check for gaps. I hope the school will arrange more similar practical links in the future so that students can apply what they have learned.

In the design, I was asked to be patient, persistent and careful. If I am not careful, a small mistake will lead to incorrect results. However, I need to be patient enough to check the mistakes. Through the problems encountered in this design and design, I have accumulated some experience, which is helpful for the future design of integrated circuits. In the process of applying VHDL, I really understand the difference between parallel running and sequential execution of other software, and its advantages in circuit design. It is convenient and flexible to design digital system with VHDL hardware description language. Using EDA software to compile and optimize the simulation greatly reduces the circuit design time and possible errors, and reduces the development cost. This design method will play an increasingly important role in the future digital system design.

refer to

Wang Aiying. Computer composition and structure. Beijing: Tsinghua University Publishing House, 200 1.2,

[2] Huang Renxin. EDA technology practice course. Beijing: Tsinghua University Publishing House, 2006.

[3] Cao,, Nie,. EDA technology experiment and course design. Beijing: Tsinghua University Publishing House, May 2006.

Yang Yihua, Yan Ming. Introduction to digital circuit EDA. Beijing: Beijing University of Posts and Telecommunications Press, 2003.

[5] Peng Rongxiu, Fundamentals of Digital Electronics Technology, Wuhan, Wuhan University of Technology Press, 2005.

[6] Pan Song, Huang "EDA Technology and VHDL", Beijing, Tsinghua University Publishing House, 2006.