Taxi Meter Based on CPLD / FPGA

Abstract: This paper introduces the composition and working principle of taxi meter system, and briefly describes the design idea and implementation process of the digital system composed of single-chip CPLD device on EDA platform. The design methods and skills of vehicle model adjustment module, meter module, billing module, decoding dynamic scanning module are discussed.

Key words: CPLD / PPGA hardware description language taxi meter MAX Plus software digital system

With the rapid development of EDA technology, the design technology and tools of electronic system have undergone profound changes. The emergence of large-scale programmable logic device CPLD / FPGA has brought many conveniences to designers. Using it for product development not only has low cost, short cycle and high reliability, but also has complete intellectual property rights. This paper introduces a taxi meter system with Altera programmable logic chip EPM7128SLC84-15 as the control core and some peripheral circuits.

1 system composition

The composition of is shown in Figure 1. The main functions of each part are as follows: (1) a counter counts the pulse signal sent by the wheel sensor (one pulse per revolution). The wheel diameters of different models may be different. Select the model through "setting 1" to adjust the vehicles with different wheel diameters. (2) The B counter accumulates the 100 meter pulse and outputs the BCD code of the actual kilometers to the decoding dynamic scanning module. Send a pulse to the C counter every 500. "Setting 2" realizes the prefabrication of starting kilometers. (3) C counter realizes cumulative counting with variable step size (i.e. adjustable unit price), and charges once every 500 meters. "Setting 3" is used to complete over price charging, starting price prefabrication, etc. (4) Decoding / dynamic scanning decodes the distance and cost and drives the nixie tube by dynamic scanning. (5) The digital tube display uses the four digit LED digital tube to display the kilometers and billing amount (three integers and one decimal).

2 function module design

The taxi meter is composed of model adjustment module, meter module, billing module, decoding dynamic and scanning modules. The whole system adopts modular design. Firstly, the functional modules are written in VHDL, and then the top-level schematic diagram is used to connect the functional modules.

2.1 model adjustment module

Taxi models are not single, and the tire diameter of each model is also different. According to the survey and statistics, there are roughly four kinds of taxi tire diameters, which are 520mm, 540mm, 560mm and 580mm respectively. To make taxis of different models send out a pulse every 100 meters, it can be completed by setting the coefficient of "prefabricated frequency divider". The frequency division coefficients calculated from the above wheel diameters are 61, 59, 57 and 55 respectively. The preset data is controlled by two vehicle type setting switches. The corresponding relationship between DIP switch status and wheel diameter is shown in Table 1 (in the table, "1" is high level and "0" is low level).

Table 1 model setting

In parameter prefabrication, use with_ Select statement (look-up table method) for frequency division selection:

The frequency divider adopts an addition frequency division circuit, its duty cycle can be adjusted by datal (x), and the frequency divider has a "start" / "reset" end (high-level reset). The timing simulation waveform is shown in Figure 2. It can be seen from the figure that for the vehicle with the switch set to "10", when the 57th pulse arrives, the oclk end of the module changes from high to low and outputs a low-level signal. See Figure 4 for the package of model adjustment module (hereinafter referred to as FP).

2.2 meter module

The metering module is an addition counter with modulus of 10 and step size of 1. The module can preset parameters so that after the actual count value is greater than the preset value, a pulse is sent every 500 meters, and the count value is sent to the decoding dynamic scanning module for display. The prefabricated parameters adopt uncompressed BCD code, so the six binary states 1010 to 1111 must be skipped during counter design. In VHDL program, it is implemented with if statement.

if km(3 downto 0)=“1001”then km:=km“0111”:

else km:=kin1;

end ifï¼›

The meter module also has a "start" / "reset" end. Parameter prefabrication also uses with_ Select statement. The corresponding relationship between "starting mileage" and "switch setting" is shown in Table 2. The package of meter module (hereinafter referred to as mile) is shown in Figure 4.

Table 2 starting mileage setting

2.3 billing module

The billing module is an addition counter with modulus of 10 and variable step size. The module prefabricates the step size through the switching value, and changes the step size when a certain prefabrication parameter is exceeded. The billing module also adopts uncompressed BCD code, but the step size is not 1, so it must be adjusted when adding uncompressed BCD, otherwise it may lead to over range error when exceeding or not exceeding the preset parameters. Here, the AF flag bit imitating the microcomputer is adopted, and a half carry flag is set on it. When the cumulative sum is greater than 9 or the half carry flag is "1", the cumulative sum is adjusted.

Where data (4) is the half carry flag. The setting parameters of "starting price" and "over price plus fee" are shown in Table 3 and table 4 respectively. The packaging of billing module (hereinafter referred to as money) is shown in Figure 4.

Table 3 starting price setting

Table 4 over price fee setting

2.4 display module

The display module consists of Seven Segment LED nixie tube decoding and dynamic scanning display.

2.4.1 decoding of Seven Segment LED nixie tube

This design uses a common cathode seven segment nixie tube. According to the corresponding relationship between hexadecimal number and seven segment display segment code table, VHDL with is used_ Select or when_ Else statements facilitate their decoding.

Figure 2

2.4.2 dynamic scanning display

Dynamic scanning uses the visual persistence principle of human eyes. As long as the scanning frequency is not less than 24Hz, human eyes can't feel the flicker of the display. The 24Hz scanning pulse of the system is provided by the corresponding peripheral circuit. The key to the design of dynamic scanning circuit is that the bit selection signal should correspond to the displayed data one by one in time sequence, so the synchronous pulse signal must be provided in the circuit. Octal counter is used here to provide synchronization pulse, and VHDL program section is as follows:

The timing simulation of bit selection signal is shown in Figure 3. From the timing simulation diagram and the above program, it can be seen that the bit selection signal is synchronized with the data to be displayed.

Figure 3

The display of decimal point in dynamic scanning circuit cannot be completed in decoding circuit. Since the position of the decimal point is fixed, another signal can be generated by the synchronization signal provided by the counter to control DP. The VHDL program is implemented as follows:

if (count:“101”or count=“001”)then data(0)

บทความที่แนะนำ
Himalayan Power Module: Set a New Benchmark for Power Module
Himalaya is the name we use to call our switching regulator technology with minimum power consumption, minimum size and integrated FET. Represents the most efficient device in the industry. Understand how these power modules become market disruptors.
The Total Sales Volume of Beidou Navigation Chips Has Exceeded 70 Million, and the Basic Products Ha
Speed of Includegraphics Seemingly Dependent on How Many Packages Are Loaded!
How Much Does a Hamster Cage Cost?
Why Didn't Noah Have Any Grandchildren in the Ark?
Cheap but Fabulous Wedding Decoration Ideas
Children
Does Anyone Have the Recipe for the Olive Garden Pumpkin Cheesecake? It Was WONDERFUL!?
How Can You Make Your Washer Run with the Lid Open?
What Kind of Phone Should I Get?
related searches
Himalayan Power Module: Set a New Benchmark for Power Module
The Total Sales Volume of Beidou Navigation Chips Has Exceeded 70 Million, and the Basic Products Ha
Speed of Includegraphics Seemingly Dependent on How Many Packages Are Loaded!
How Much Does a Hamster Cage Cost?
Why Didn't Noah Have Any Grandchildren in the Ark?
Cheap but Fabulous Wedding Decoration Ideas
Children
Does Anyone Have the Recipe for the Olive Garden Pumpkin Cheesecake? It Was WONDERFUL!?
How Can You Make Your Washer Run with the Lid Open?