• No results found

Report- VHDL Tachometer

N/A
N/A
Protected

Academic year: 2021

Share "Report- VHDL Tachometer"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

Table of Contents

Table of Contents

Tachometer...3 Tachometer...3 Introduction...3 Introduction...3

 Need for a Tachometer...3

 Need for a Tachometer...3

Abstract...5 Abstract...5 Research Focus...5 Research Focus...5 Issue(s) Addressed...5 Issue(s) Addressed...5 Research Method...5 Research Method...5

Conclusions and Recommendations...5

Conclusions and Recommendations...5

Operation...6 Operation...6 RPM transducer...6 RPM transducer...6 Clock Generator...6 Clock Generator...6

Digital To Analog Converter...7

Digital To Analog Converter...7

Pointer...7 Pointer...7 RTL Schematic...8 RTL Schematic...8 CLOCKDIV...8 CLOCKDIV...8 TMETER...8 TMETER...8 VHDL Code...9 VHDL Code...9 System...9 System...9 CLKDIV...11 CLKDIV...11 TMETER...12 TMETER...12 VHDL Simulation...14 VHDL Simulation...14 System Overview...15 System Overview...15 System Detail -1...16 System Detail -1...16 System Detail -2...17 System Detail -2...17 Reset Action...18 Reset Action...18 CLKDIV...19 CLKDIV...19 TMETER...20 TMETER...20 Implementation Report...21 Implementation Report...21 CPLD Fitter Report...21 CPLD Fitter Report...21 Resources summary...21 Resources summary...21 Pin resources...21 Pin resources...21 Global resources...21 Global resources...21 Power Data...21 Power Data...21 Inputs...22 Inputs...22 Function Blocks...22 Function Blocks...22 Compiler Options...22 Compiler Options...22 Pin List...23 Pin List...23 Implementation Diagram...25 Implementation Diagram...25 Conclusions...26 Conclusions...26 Bibliography...27 Bibliography...27

(3)

Tachometer 

Tachometer 

Introduction Introduction

A tachometer (also called a revolution-counter, "Tach", rev-counter, or RPM gauge) is A tachometer (also called a revolution-counter, "Tach", rev-counter, or RPM gauge) is an instrument that measures the rotation speed of a shaft or disk,

an instrument that measures the rotation speed of a shaft or disk, as in a motor oras in a motor or other machine. The device usually display

other machine. The device usually displays the revolutions per minute (RPM) on s the revolutions per minute (RPM) on aa

calibrated analogue dial, but digital displays are increasingly common. The term comes calibrated analogue dial, but digital displays are increasingly common. The term comes from Greek

from Greek Ταχος,Ταχος,, "speed", and, "speed", andmetronmetron, "to measure"., "to measure".

Need for a Tachometer Need for a Tachometer

Tachometers or rev counters on automobiles, aircraft, and other vehicles show the rate Tachometers or rev counters on automobiles, aircraft, and other vehicles show the rate of rotation of the

of rotation of the engine's crankshaft, and typically have markings indicating a safeengine's crankshaft, and typically have markings indicating a safe range of rotation speeds. This can

range of rotation speeds. This can assist the driver in assist the driver in selecting appropriatselecting appropriate throttle ande throttle and gear settings for the

gear settings for the driving conditions. Prolonged use at high speeds may causedriving conditions. Prolonged use at high speeds may cause inadequate lubrication, overhe

inadequate lubrication, overheating (exceeding capability of ating (exceeding capability of the cooling the cooling system),system), exceeding speed capability of sub-parts of the engine

exceeding speed capability of sub-parts of the engine (for example spring retracted(for example spring retracted valves) thus causing excessive wear or permanent damage or failure of engines. valves) thus causing excessive wear or permanent damage or failure of engines. On analogue tachometers, speeds above maximum safe

On analogue tachometers, speeds above maximum safe operating speed are typicallyoperating speed are typically indicated by an area of

indicated by an area of the gauge marked in red, giving rise the gauge marked in red, giving rise to the expression of to the expression of  "redlining" an engine

"redlining" an engine — revving the engine up to the maximum safe limit.— revving the engine up to the maximum safe limit. In vehicles such as tractors and trucks,

In vehicles such as tractors and trucks, the tachometer often has other markings,the tachometer often has other markings, usually a green arc showing the speed range in which the engine produces maximum usually a green arc showing the speed range in which the engine produces maximum

 Illustration 1: Automobile

(4)

torque, which is of prime interest to operators of such vehicles. Tractors fitted with a torque, which is of prime interest to operators of such vehicles. Tractors fitted with a power take off (PTO) system have tachometers showing the engine speed needed to power take off (PTO) system have tachometers showing the engine speed needed to rotate the PTO at the

rotate the PTO at the standardized speed required by most PTO-driven implements. Instandardized speed required by most PTO-driven implements. In many countries, tractors are required to have a speedometer for use on a road. To save many countries, tractors are required to have a speedometer for use on a road. To save fitting a second dial, the vehicle's tachometer is often marked with a second scale in fitting a second dial, the vehicle's tachometer is often marked with a second scale in units of speed. This scale is only accurate in a certain

units of speed. This scale is only accurate in a certain geargear, but since many tractors, but since many tractors only have one gear that is

only have one gear that is practical for use on-road, this ipractical for use on-road, this is sufficient. Tractors withs sufficient. Tractors with multiple 'road gears' often hav

multiple 'road gears' often have tachometers with more than e tachometers with more than one speed scale. Aircraftone speed scale. Aircraft tachometers hav

tachometers have a green e a green arc showing the engine's designed cruising arc showing the engine's designed cruising speed range.speed range. A tachometer is vital

A tachometer is vital is preventing engine over-speeis preventing engine over-speed.d. Overspee

Overspeed is a d is a condition in which an engine is condition in which an engine is allowed or forced to turn beyallowed or forced to turn beyond itsond its design limit. The consequences of running an engine too fast vary by engine type and design limit. The consequences of running an engine too fast vary by engine type and model and depend upon several factors, chief amongst them the

model and depend upon several factors, chief amongst them the duration of theduration of the overspee

overspeed and by d and by the speed attained. With some the speed attained. With some engines even a momentary overspeedengines even a momentary overspeed can result in greatly reduced engine life or

can result in greatly reduced engine life or even catastropheven catastrophic failure. The speed of aic failure. The speed of ann engine is ordinarily measured in

engine is ordinarily measured in revolurevolutions per minute (RPM).tions per minute (RPM). Typical maximal RPMs of

Typical maximal RPMs of performance engines are provided in the following table:performance engines are provided in the following table:

A

Auuttoommoobbiillee MMaaxxiimmuum m EEnnggiinne e SSppeeeedd Audi

Audi R8 R8 V8 V8 8000 8000 rpmrpm Audi

Audi Q7 Q7 6.0 6.0 V12 V12 diesel diesel 4750 4750 rpmrpm Bugatti

Bugatti Veyron Veyron turbocharged turbocharged W16 W16 6500 6500 rpmrpm Honda

Honda S2000 S2000 I4 I4 8200 8200 rpmrpm Lexus

Lexus LFA LFA V10 V10 9000 9000 rpmrpm Volkswagen

Volkswagen Golf Golf GTI GTI 2.0TSI 2.0TSI I4 I4 6500 6500 rpmrpm Nissan

Nissan GTR GTR turbochargeturbocharged d V6 V6 7000 7000 rpmrpm Ferrari

Ferrari Enzo Enzo V12 V12 8000 8000 rpmrpm T

Table 1: able 1: TTypical Engine ypical Engine Speed RatingsSpeed Ratings

As an example of what a tachometer can be used for, think of driving a car up a hill. By As an example of what a tachometer can be used for, think of driving a car up a hill. By watching the tachometer, you will know if you should shift gears. This gives a visual watching the tachometer, you will know if you should shift gears. This gives a visual cue to help you drive your car in the most efficient manner.

cue to help you drive your car in the most efficient manner. Thus a tachometer is a

Thus a tachometer is a vital instrument which allows a vehicle operator to select thevital instrument which allows a vehicle operator to select the correct gear for maximum efficiency and

correct gear for maximum efficiency and performanceperformance, and allows him , and allows him or her toor her to operate the engine within safe parameters.

(5)

Abstract

Abstract

Research Focus Research Focus

The objective of this project is to design,

The objective of this project is to design, implement, simulatimplement, simulate and synthesize the logice and synthesize the logic required for the operations of a Tachometer. The prime focus of the design was to required for the operations of a Tachometer. The prime focus of the design was to match the accuracy and reliability of analog

match the accuracy and reliability of analog tachometers, while at the same timetachometers, while at the same time reducing cost of the instrument by minimizing mechanical parts. The output is to be reducing cost of the instrument by minimizing mechanical parts. The output is to be obtained by driving a mechanical pointer, since it is

obtained by driving a mechanical pointer, since it is more convenient to read duringmore convenient to read during driving.

driving.

Issue(s) Addressed Issue(s) Addressed

Two constraints were kept in mind during the design of the circuit. First,

Two constraints were kept in mind during the design of the circuit. First, the designthe design was to have the maximum possible clock speed, in order for the

was to have the maximum possible clock speed, in order for the precision of the deviceprecision of the device not to be sacrifices. The second, to minimize cost, the

not to be sacrifices. The second, to minimize cost, the design was to be fitted inside adesign was to be fitted inside a CPLD with 108

CPLD with 108 macrocellsmacrocells11..

During simulation, propagation delays in the

During simulation, propagation delays in the internal latches were reducing the speedinternal latches were reducing the speed of operation. This issue was resolved by splitting the

of operation. This issue was resolved by splitting the design internally into multipledesign internally into multiple blocks.

blocks.

The timing generation was derived internall

The timing generation was derived internally by dividing a y by dividing a 10Mhz clock and setting up10Mhz clock and setting up a PWM

a PWM22, in , in a block separate from the counter to enhance customizable and reduce thea block separate from the counter to enhance customizable and reduce the

need for external components. need for external components.

Research Method Research Method

The design was described in VHDL

The design was described in VHDL33 and compiled and simulated in ModelSim III XE. and compiled and simulated in ModelSim III XE. ItIt

was then implemented in Xilinx ISE Project Navigator and was targeted on an was then implemented in Xilinx ISE Project Navigator and was targeted on an Automotive XC95108. Synthesis and Fitting of the logic was then carried out. The Automotive XC95108. Synthesis and Fitting of the logic was then carried out. The Automotive part was chosen for its higher reliability.

Automotive part was chosen for its higher reliability.

Conclusions and

Conclusions and RecommendationsRecommendations The design was successfull

The design was successfully synthesized on a y synthesized on a XC9510XC95108 CPLD with a 8 CPLD with a maximum possiblemaximum possible clock of 83.33 Mhz. We found that by targeting a newer device like the CoolRunner2, clock of 83.33 Mhz. We found that by targeting a newer device like the CoolRunner2, the clock speed may be increased to 140+ Mhz, using the same design.

the clock speed may be increased to 140+ Mhz, using the same design.

1

1 A maA macrocell array is a precrocell array is a prefabricated array fabricated array of higher-level logof higher-level logic functions such as flip-ic functions such as flip-flops, flops, ALU functions, rALU functions, registers etc.egisters etc. 2

2 PWM PWM = = Pulse Pulse Width Width ModulationModulation 3

(6)

Operation

Operation

The block diagram of the system is

The block diagram of the system is shown below:shown below:

The main components of the

The main components of the system are:system are: 1.

1. RPRPM TrM Tranansdsducucerer 2.

2. ClClocock k GeGeneneraratotorr 3.

3. DigDigital ital to Ato Analnalog cog convonvertertoror 4.

4. PoPoininteter r DiDispsplalayy

RPM transducer RPM transducer

A contactless ferromagnetic sensor can be used

A contactless ferromagnetic sensor can be used to measure the spinning speed of theto measure the spinning speed of the engine without causing frictional losses.

engine without causing frictional losses. The RPM Transducer PR 9376 The RPM Transducer PR 9376 is ideally suitedis ideally suited for such measurement. Due to high resolution, fast internal electronic and

for such measurement. Due to high resolution, fast internal electronic and the sharpthe sharp edged output pulses the PR 9376 is suitable for measurement of extremely high as well edged output pulses the PR 9376 is suitable for measurement of extremely high as well as very low rotational speeds with

as very low rotational speeds with high resolution.high resolution.

Clock Generator Clock Generator The CDCS502 is a

The CDCS502 is a spread spectrum capable, fundamenspread spectrum capable, fundamental mode crystal oscillator withtal mode crystal oscillator with selectable frequency multiplica

selectable frequency multiplication. It tion. It features an advanced gain controlledfeatures an advanced gain controlled fundamental mode crystal oscillator stage with a built-in load capacitance of

fundamental mode crystal oscillator stage with a built-in load capacitance of 10pF10pF. This. This oscillator stage accepts crystals from 8MHz to 32MHz with an ESR of up to 180 Ω . The oscillator stage accepts crystals from 8MHz to 32MHz with an ESR of up to 180 Ω . The stage can be used with crystals with power dissipation of 50 µ W and

stage can be used with crystals with power dissipation of 50 µ W and up. The inputup. The input signal is

signal is processed by a PLL, whose output frequency is processed by a PLL, whose output frequency is either equal to the inputeither equal to the input frequency or multiplied by the factor of 4,

(7)

Digital To Analog Converter Digital To Analog Converter

The AD5543/AD5553 are precision 16-/14-bit, low power, current output, small form The AD5543/AD5553 are precision 16-/14-bit, low power, current output, small form factor digital-to-analog converters (DA

factor digital-to-analog converters (DACs). They are designed to operate from a Cs). They are designed to operate from a single 5single 5 V supply with a ±10 V multiplying reference. The applied external reference, VREF, V supply with a ±10 V multiplying reference. The applied external reference, VREF, determines the full-scale output current. An

determines the full-scale output current. An internal feedback resistor (RFB) facilitatesinternal feedback resistor (RFB) facilitates the R-2R and temperature tracking for voltage conversion when combined with an the R-2R and temperature tracking for voltage conversion when combined with an external op amp. These can accurately convert the digital output to drive the pointer. external op amp. These can accurately convert the digital output to drive the pointer.

Pointer Pointer

A galvanometer may be used for displaying the reading to the vehicle operator. A A galvanometer may be used for displaying the reading to the vehicle operator. A galv

galvanometer is a anometer is a type of ammeter: an type of ammeter: an instrument for detecting and measuring electricinstrument for detecting and measuring electric current. It is a

current. It is an analog electromechanical transducern analog electromechanical transducer44that produces a rotary deflectionthat produces a rotary deflection

of some type of pointer in response to electric current flowing through its coil. The of some type of pointer in response to electric current flowing through its coil. The term has expanded to include uses of the same mechanism in recording, positioning, term has expanded to include uses of the same mechanism in recording, positioning, and servomechanism

and servomechanism equipment.equipment.

A analog meter is preferred because it is easier for a vehicle operator to read while A analog meter is preferred because it is easier for a vehicle operator to read while driving the machine.

driving the machine.

4

4 transducer transducer is a is a device that device that converts one converts one type of type of energy energy to anotherto another..

 Illustration 2: Galvanometer   Illustration 2: Galvanometer 

(8)

RTL Schematic

RTL Schematic

The system consists of two main sub-circuits. The system consists of two main sub-circuits.

1 1.. CCLLOOCCKKDDIIVV 2 2.. TTMMEETTEER R  CLOCKDIV CLOCKDIV

It divides the master CLOCK signal such that a pulse of 80% duty cycle and adequate It divides the master CLOCK signal such that a pulse of 80% duty cycle and adequate duration is setup up. By modifying

duration is setup up. By modifying this block the device can this block the device can be made to measure fasterbe made to measure faster or slower spin speeds.

or slower spin speeds.

TMETER TMETER

This consists of

This consists of a 16 bit a 16 bit countercounter, gating and , gating and auto-reset logic. This counts the rotationsauto-reset logic. This counts the rotations per gate pulse and outputs the result on

per gate pulse and outputs the result on the RESULT [0:15] bus. That in turn drives athe RESULT [0:15] bus. That in turn drives a DAC and hence the pointer.

DAC and hence the pointer.

 Illustration 3: Entity Diagram  Illustration 3: Entity Diagram

(9)

VHDL Code

VHDL Code

System

System

-- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- -- _____ _____ _ _ __ ---- ||_ _ __||_ _ _ _ ______| | ||___ _ _____ _ _ _ ___ _ _____ _ ______| | ||_ _ _____ _ _ _ ____ --- - | | ||/ / __` ` ||/ / ____| | ''_ _ \ \ / / _ _ \\| | ''_ _ ` ` _ _ \ \ / / _ _ \ \ ____/ / _ _ \ \ ''____|| --- - | | | | ((__| | | | ((____| | | | | | | | ((__) ) | | | | | | | | | | | | ____/ / ||| | ____/ / || --- - ||__||\\____,,__||\\______||__| | ||__||\\______//||__| | ||__| | ||__||\\______||\\____\\______||__|| ---- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+ -- +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+ -- |S|h|a|u|n|a|k| |D|e| |a|n|d| |N|i|k|h|i|l| |A|.| -- |S|h|a|u|n|a|k| |D|e| |a|n|d| |N|i|k|h|i|l| |A|.| -- +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+ -- +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+

-- VHDL Code to ganetare timing, control logig and -- VHDL Code to ganetare timing, control logig and -- measure RPM of an rotating part. eg: Engine. -- measure RPM of an rotating part. eg: Engine.

---- The Ports are as follows: -- The Ports are as follows: -- INPUT: CLOCK, MOTORIN, RST -- INPUT: CLOCK, MOTORIN, RST -- OUTPUT: RESULT -- OUTPUT: RESULT ---- 15 OCT 2010, V1.1 -- 15 OCT 2010, V1.1 -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ LIBRARY IEEE; LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY SYSTEM IS ENTITY SYSTEM IS PORT( PORT( CLOCK: IN STD_LOGIC; CLOCK: IN STD_LOGIC; MOTORIN: IN STD_LOGIC; MOTORIN: IN STD_LOGIC; RST: IN STD_LOGIC; RST: IN STD_LOGIC;

RESULT: OUT INTEGER RANGE 0 TO 65535 RESULT: OUT INTEGER RANGE 0 TO 65535 );

);

END SYSTEM; END SYSTEM;

ARCHITECTURE SYS OF SYSTEM IS ARCHITECTURE SYS OF SYSTEM IS

C COOMMPPOONNEENNT T TTMMEETTEER R IIS S PPOORRTT(( GGAATTEE: : IIN N SSTTDD__LLOOGGIICC;; --- - MMAASSTTEERR MOTOR: IN STD_LOGIC; MOTOR: IN STD_LOGIC; RESET : IN STD_LOGIC; RESET : IN STD_LOGIC;

(10)

SSD: OUT INTEGER RANGE 0 TO 65535 SSD: OUT INTEGER RANGE 0 TO 65535 );

);

END COMPONENT; END COMPONENT;

COMPONENT CLKDIV IS PORT( COMPONENT CLKDIV IS PORT(

CLK: IN STD_LOGIC; CLK: IN STD_LOGIC; CLKOUT: OUT STD_LOGIC CLKOUT: OUT STD_LOGIC ); ); END COMPONENT; END COMPONENT; SIGNAL CLKTRN: STD_LOGIC; SIGNAL CLKTRN: STD_LOGIC; BEGIN BEGIN

CLOCKDIV: CLKDIV PORT MAP (CLK=>CLOCK, CLKOUT=>CLKTRN); CLOCKDIV: CLKDIV PORT MAP (CLK=>CLOCK, CLKOUT=>CLKTRN);

TACHMETER: TMETER PORT MAP (GATE=>CLKTRN, MOTOR=>MOTORIN, RESET => TACHMETER: TMETER PORT MAP (GATE=>CLKTRN, MOTOR=>MOTORIN, RESET => RST, SSD=>RESULT);

RST, SSD=>RESULT);

END SYS; END SYS;

(11)

CLKDIV

CLKDIV

-- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- Entity to set up PWM pulses and divide master clock.

-- Entity to set up PWM pulses and divide master clock. -- Ports of the entity are as follows:

-- Ports of the entity are as follows: -- IN: CLK -- IN: CLK -- OUT: CLKOUT -- OUT: CLKOUT -- 15 OCT 2010, V1.1 -- 15 OCT 2010, V1.1 -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ LIBRARY IEEE; LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY CLKDIV IS ENTITY CLKDIV IS PORT( PORT( CLK: IN STD_LOGIC; CLK: IN STD_LOGIC; CLKOUT: OUT STD_LOGIC CLKOUT: OUT STD_LOGIC );

);

END CLKDIV; END CLKDIV;

ARCHITECTURE DIV OF CLKDIV IS ARCHITECTURE DIV OF CLKDIV IS BEGIN

BEGIN

PROCESS (CLK) PROCESS (CLK)

VARIABLE COUNT: INTEGER RANGE 0 TO 12501 :=0; VARIABLE COUNT: INTEGER RANGE 0 TO 12501 :=0; VARIABLE STATE: STD_LOGIC := '1';

VARIABLE STATE: STD_LOGIC := '1'; BEGIN

BEGIN

IF(CLK'EVENT

IF(CLK'EVENT and and CLK='1') CLK='1') THEN THEN -- -- SET SET UP UP COUNTERCOUNTER IF(COUNT=12500)THEN IF(COUNT=12500)THEN COUNT:=0; COUNT:=0; STATE:= '1'; STATE:= '1'; ELSE ELSE COUNT := COUNT+1; COUNT := COUNT+1; END IF; END IF; IF(COUNT=10000)THEN

IF(COUNT=10000)THEN -- -- SET SET UP UP PWMPWM STATE:= NOT STATE;

STATE:= NOT STATE; END IF; END IF; END IF; END IF; CLKOUT <= STATE; CLKOUT <= STATE; END PROCESS; END PROCESS; END DIV; END DIV;

(12)

TMETER

TMETER

-- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- Entity to count gated pulses and auto reset.

-- Entity to count gated pulses and auto reset.

---- Ports of the entity are as follows: -- Ports of the entity are as follows: -- IN: GATE, MOTOR, RESET

-- IN: GATE, MOTOR, RESET -- OUT: SSD -- OUT: SSD ---- 15 OCT 2010, V1.1 -- 15 OCT 2010, V1.1 -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ LIBRARY IEEE; LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY TMETER IS ENTITY TMETER IS P POORRTT( G( GAATTEE: : IIN N SSTTDD__LLOOGGIICC;; --- - EENNAABBLLE E GGAATTEE M MOOTTOORR: : IIN N SSTTDD__LLOOGGIICC;; --- - CCOOUUNNTTEERR CLOCK CLOCK R REESSEET T : : IIN N SSTTDD__LLOOGGIICC;; --- - AASSYYNNCC RESET RESET S SSSDD: : OOUUT T IINNTTEEGGEER R RRAANNGGE E 0 0 TTO O 6655553355 --- - OOUUTTPPUUTT ); ); END TMETER; END TMETER;

ARCHITECTURE TACH OF TMETER IS ARCHITECTURE TACH OF TMETER IS BEGIN

BEGIN

PROCESS (MOTOR, GATE, RESET) PROCESS (MOTOR, GATE, RESET)

V VAARRIIAABBLLE E NN::IINNTTEEGGEER R RRAANNGGE E 0 0 TTO O 6655553355 ::= = 00;; BEGIN BEGIN I IF F GGAATTEE==''11' ' AANND D GGAATTEE''EEVVEENNT T TTHHEENN --- - AAUUTTOO RESET SYSTEM ON GATE ROLL

RESET SYSTEM ON GATE ROLL N := 0; N := 0; END IF; END IF; IF N=65535 THEN IF N=65535 THEN N := 0; N := 0; END IF; END IF; I IF F MMOOTTOORR==''11' ' AANND D GGAATTEE==''11' ' TTHHEEN N --- - CCOOUUNT NT MMOOTTOORR TICKS TICKS N := N+1; N := N+1; END IF; END IF;

(13)

I

IFF GGAATTEE==''00'' THTHEENN ---- LLAATTCCHH COUNT TO OUTPUT LINES

COUNT TO OUTPUT LINES SSD SSD <= <= N;N; END IF; END IF; I IFF RREESSEETT==''11'' THTHEENN ---- AASSYYNNCC RESET LOGIC RESET LOGIC N:=0; N:=0; SSD <=N; SSD <=N; END IF; END IF; END PROCESS; END PROCESS; END TACH; END TACH;

(14)

VHDL Simulation

VHDL Simulation

VHDL code attached above was compiled and simulated in ModelSim XE III (Started VHDL code attached above was compiled and simulated in ModelSim XE III (Started Edition).

Edition).

Simulation was with a 100 picoseconds clock.

Simulation was with a 100 picoseconds clock. The results were then split into variousThe results were then split into various different timescales to allow observations on all features of the circuit.

different timescales to allow observations on all features of the circuit. The circuit was implemented in ISE Project Navigator 12.2

The circuit was implemented in ISE Project Navigator 12.2

The results of the simulation and Implementation reports are attached ahead. The results of the simulation and Implementation reports are attached ahead.

 Illustration 4: Simulation in ModelSim  Illustration 4: Simulation in ModelSim

(15)

System Overview System Overview

(16)

System Detail -1 System Detail -1

(17)

System Detail -2 System Detail -2

(18)

Reset Action Reset Action

(19)

CLKDIV CLKDIV

(20)

TMETER TMETER

(21)

Implementation Report

Implementation Report

The design was implemented in ISE Project Navigator on an Automotive XC95108 The design was implemented in ISE Project Navigator on an Automotive XC95108 device. The result of the implementation are as follows:

device. The result of the implementation are as follows:

CPLD Fitter Report CPLD Fitter Report SYSTEM SYSTEM Successful Successful M.63c M.63c XC95108-7-PC84 XC95108-7-PC84 10-17-2010, 11:55PM 10-17-2010, 11:55PM Resources summary Resources summary Macrocells Macrocells Used

Used PPtteerrmms s UUsseedd RReeggiisstteerrs s UUsseedd PPiinns s UUsseedd

Function Block Function Block Inputs Used Inputs Used 9 911//11008 8 ((8855%%)) 222222//55440 0 ((4422%%)) 3311//11008 8 ((2299%%)) 1919//669 9 ((2288%%)) 117755//22116 6 ((8822%%)) Pin resources Pin resources S Siiggnnaal l TTyyppee RReeqquuiirreedd MMaappppeedd IInnppuutt 22 22 O Ouuttppuutt 1166 1166 B

Biiddiirreeccttiioonnaall 00 00

G GCCKK 11 11 G GTTSS 00 00 G GSSRR 00 00 Global resources Global resources

Signal mapped onto global clock net Signal mapped onto global clock net (GCK1)

(GCK1) CLOCKCLOCK

Power Data Power Data

Macrocells in high performance mode Macrocells in high performance mode (MCHP)

(MCHP) 9191

M

Macacrorocecelllls is in ln low ow ppowower er momode de (M(MCLCLP)P) 00 T

Toottaal l mmaaccrroocceelllls s uusseed d ((MMCC)) 9911

Design Name Design Name Fitting Status Fitting Status Software Version Software Version Device Used Device Used Date Date

(22)

Inputs

Inputs

Signal Name

Signal Name FunctionFunction Block Block Macrocel Macrocel ll Pin Pin Number Number Pin Pin Type Type Pin Pin Use Use C

CLLOOCCKK FFBB11 MMCC1122 99 I/O/GCI/O/GC K1 K1 GCKGCK M MOOTTOORRIINN FFBB55 MCMC1177 4444 II//OO II R RSSTT FFBB22 MMCC33 7722 II//OO II

Function Blocks

Function Blocks

Function Function Block Block Macrocells Macrocells Used/Total Used/Total Function Block Function Block Inputs

Inputs Used/TotUsed/Totalal

Product Terms Product Terms Used/Total Used/Total Pins Pins Used/Tota Used/Tota ll FFBB11 112 2 / / 1188 227 7 / / 3636 224 4 / / 9090 1 1 / / 1122 FFBB22 116 6 / / 1188 332 2 / / 3636 442 2 / / 9090 4 4 / / 1122 FFBB33 116 6 / / 1188 332 2 / / 3636 447 7 / / 9090 4 4 / / 1122 FFBB44 116 6 / / 1188 332 2 / / 3636 443 3 / / 9090 4 4 / / 1111 FFBB55 115 5 / / 1188 332 2 / / 3636 339 9 / / 9090 3 3 / / 1111 FFBB66 116 6 / / 1188 220 0 / / 3636 227 7 / / 9090 2 2 / / 1111

Compiler Options

Compiler Options

Following is a list of all global compiler options used by the fitter run. Following is a list of all global compiler options used by the fitter run. Device(s)

Device(s) Specified Specified : : xc95108-7-PC84xc95108-7-PC84 Optimization

Optimization Method Method : : DENSITYDENSITY Multi-Level

Multi-Level Logic Logic Optimization Optimization : : ONON Ignore

Ignore Timing Timing Specifications Specifications : : OFFOFF Default

Default Register Register Power Power Up Up Value Value : : LOWLOW Keep

Keep User User Location Location Constraints Constraints : : ONON What-You-See-Is-What-You-G

What-You-See-Is-What-You-Get et : : OFFOFF Exhaustive

Exhaustive Fitting Fitting : : OFFOFF Keep

Keep Unused Unused Inputs Inputs : : OFFOFF Slew

Slew Rate Rate : : FASTFAST Power

Power Mode Mode : : STDSTD Ground

Ground on on Unused Unused IOs IOs : : OFFOFF Global

Global Clock Clock Optimization Optimization : : ONON Global

Global Set/Reset Set/Reset Optimization Optimization : : ONON Global

Global Ouput Ouput Enable Enable Optimization Optimization : : ONON FASTConnect/UIM

FASTConnect/UIM optimzation optimzation : : ONON Local

Local Feedback Feedback : : ONON Pin

Pin Feedback Feedback : : ONON Input

Input Limit Limit : : 3636 Pterm

(23)

Pin List

Pin List

Device : XC95108-7-PC84 Device : XC95108-7-PC84 ---/11 /11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 84 84 83 83 82 82 81 81 80 80 79 79 78 78 77 77 76 76 75 75 \\ | | 12 12 74 74 || | | 13 13 73 73 || | | 14 14 72 72 || | | 15 15 71 71 || | | 16 16 70 70 || | | 17 17 69 69 || | | 18 18 68 68 || | | 19 19 67 67 || | | 20 20 66 66 || | | 21 21 XC95108-7-PC84 XC95108-7-PC84 65 65 || | | 22 22 64 64 || | | 23 23 63 63 || | | 24 24 62 62 || | | 25 25 61 61 || | | 26 26 60 60 || | | 27 27 59 59 || | | 28 28 58 58 || | | 29 29 57 57 || | | 30 30 56 56 || | | 31 31 55 55 || | | 32 32 54 54 || \ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 / \ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 / ---Pin

Pin Signal Signal Pin Pin SignalSignal No.

No. Name Name No. No. NameName 1

1 RESULT<0> RESULT<0> 43 43 TIETIE 2

2 TIE TIE 44 44 MOTORINMOTORIN 3

3 TIE TIE 45 45 RESULT<15>RESULT<15> 4

4 TIE TIE 46 46 TIETIE 5

5 TIE TIE 47 47 TIETIE 6

6 TIE TIE 48 48 TIETIE 7

7 TIE TIE 49 49 GNDGND 8

8 GND GND 50 50 TIETIE 9

9 CLOCK CLOCK 51 51 TIETIE 10

10 TIE TIE 52 52 RESULT<1>RESULT<1> 11

11 TIE TIE 53 53 TIETIE 12

12 TIE TIE 54 54 TIETIE 13

13 TIE TIE 55 55 TIETIE 14

14 RESULT<3> RESULT<3> 56 56 TIETIE 15

15 TIE TIE 57 57 RESULT<2>RESULT<2> 16

16 GND GND 58 58 TIETIE 17

17 TIE TIE 59 59 TDOTDO 18

18 RESULT<4> RESULT<4> 60 60 GNDGND 19

19 TIE TIE 61 61 TIETIE 20

20 TIE TIE 62 62 RESULT<7>RESULT<7> 21

21 RESULT<5> RESULT<5> 63 63 TIETIE 22

22 VCC VCC 64 64 VCCVCC 23

23 TIE TIE 65 65 TIETIE 24

(24)

25

25 RESULT<6> RESULT<6> 67 67 TIETIE 26

26 TIE TIE 68 68 TIETIE 27

27 GND GND 69 69 RESULT<9>RESULT<9> 28

28 TDI TDI 70 70 TIETIE 29 29 TMS TMS 71 71 RESULT<10>RESULT<10> 30 30 TCK TCK 72 72 RSTRST 31 31 TIE TIE 73 73 VCCVCC 32

32 RESULT<13> RESULT<13> 74 74 TIETIE 33

33 TIE TIE 75 75 TIETIE 34

34 TIE TIE 76 76 TIETIE 35

35 TIE TIE 77 77 TIETIE 36

36 TIE TIE 78 78 VCCVCC 37

37 TIE TIE 79 79 RESULT<11>RESULT<11> 38

38 VCC VCC 80 80 TIETIE 39

39 RESULT<14> RESULT<14> 81 81 TIETIE 40

40 TIE TIE 82 82 RESULT<12>RESULT<12> 41

41 TIE TIE 83 83 TIETIE 42

42 GND GND 84 84 TIETIE

Legend

Legend : : NC NC = = Not Not Connected, Connected, unbonded unbonded pinpin

PGND = Unused I/O configured as additional Ground pin PGND = Unused I/O configured as additional Ground pin TIE

TIE = Unused = Unused I/O floating -- I/O floating -- must tie must tie to VCC, to VCC, GND or GND or other signalother signal VCC

VCC = = Dedicated Dedicated Power Power PinPin GND

GND = = Dedicated Dedicated Ground Ground PinPin TDI

TDI = = Test Test Data Data In, In, JTAG JTAG pinpin TDO

TDO = = Test Test Data Data Out, Out, JTAG JTAG pinpin TCK

TCK = = Test Test Clock, Clock, JTAG JTAG pinpin TMS

TMS = = Test Test Mode Mode Select, Select, JTAG JTAG pinpin PROHIBITED

(25)

Implementation Diagram

Implementation Diagram

(26)

Conclusions

Conclusions

The counting engine for the Tachometer was successfully implemented in VHDL and The counting engine for the Tachometer was successfully implemented in VHDL and simulated using ModelSim III XE (starter edition).

simulated using ModelSim III XE (starter edition). The code behavThe code behaves as required for thees as required for the purpose of counting and displaying, and has

purpose of counting and displaying, and has been tested to remove any bugs.been tested to remove any bugs. The design was realized on a Xilinx XC95108 in ISE Project Navigator <12.2>. The design was realized on a Xilinx XC95108 in ISE Project Navigator <12.2>.

Through the project we have enlisted the following CAD tools: Through the project we have enlisted the following CAD tools:

• ModelSim III XE:ModelSim III XE: Simulation and VHDL compilerSimulation and VHDL compiler •

• Ghostscript:Ghostscript: Printing of simulation results to PDF.Printing of simulation results to PDF. •

• GIMP:GIMP: Image and graph editing.Image and graph editing. •

• ISE Project navigator:ISE Project navigator: ImplemenImplementation on tation on CPLDCPLD

The project can hence be synthesized for transfer on

The project can hence be synthesized for transfer on a CPLD/FPGA solution, ora CPLD/FPGA solution, or processed for

(27)

Bibliography

Bibliography

Books:

Books:

• VHDL Primer – Third Edition – VHDL Primer – Third Edition – J. BhaskerJ. Bhasker •

• Digital Design, 3E – M. Morris Mano,Digital Design, 3E – M. Morris Mano, •

• Circuit Design with VHDL Circuit Design with VHDL - Volnei A. Pedroni- Volnei A. Pedroni

Websites: Websites:

• NJIT UG course:NJIT UG course:

architecture.njit.

architecture.njit.edu/academedu/academics/undergradics/undergraduate/artanduate/artanddesign/dd-brdesign/dd-brochure.pdf ochure.pdf 

• ModelSim basics:ModelSim basics:

www.

www.tkt.cs.tut.fi/ttkt.cs.tut.fi/tools/public/tuools/public/tutorials/mentorials/mentor/modelsim/gtor/modelsim/getting_started/gmetting_started/gms.hts.ht

ml

ml

• ModelSim Environment Setup:ModelSim Environment Setup: www.ece.msstate.edu/~reese/EE8993/setup.htmlwww.ece.msstate.edu/~reese/EE8993/setup.html •

• EDNC VHDL 101:EDNC VHDL 101:

www.ednc.com/bbs/data/file/pds/6734cd03_IntroModelSim60GUI.pdf 

www.ednc.com/bbs/data/file/pds/6734cd03_IntroModelSim60GUI.pdf 

• VHDL primer:VHDL primer: www.seas.upenn.edu/~ese201/vhdl/vhdl_primer.htmlwww.seas.upenn.edu/~ese201/vhdl/vhdl_primer.html •

• VHDL resources:VHDL resources: esd.cs.ucr.edu/labs/tutorial/VHDL_Page.htmlesd.cs.ucr.edu/labs/tutorial/VHDL_Page.html •

• Tachometer:Tachometer: auto.howstuffworks.com/car-driving-safety/safety-regulatory-

auto.howstuffworks.com/car-driving-safety/safety-regulatory-devices/speedometer.htm

(28)

Illustration Index

Illustration Index

Illustration 1: Automobile Tachometer...3

Illustration 1: Automobile Tachometer...3

Illustration 2: Galvanometer...7

Illustration 2: Galvanometer...7

Illustration 3: Entity Diagram...8

Illustration 3: Entity Diagram...8

Illustration 4: Simulation in ModelSim...14

Illustration 4: Simulation in ModelSim...14

Alphabetical Index

Alphabetical Index

duty cycle ...8 duty cycle ...8 Function Block...22 Function Block...22 galvanometer ...7 galvanometer ...7 instrument...4 instrument...4

ISE Project Navigator...14

ISE Project Navigator...14

macrocells...5 macrocells...5 ModelSim XE III...14 ModelSim XE III...14 R-2R...7 R-2R...7 redlining...3 redlining...3 RPM Transducer...6 RPM Transducer...6 tachometer...3 tachometer...3 TIE...24 TIE...24 XC95108...21 XC95108...21

References

Related documents

O Inverurie Interchange O Ashgrove Road West O Aberdeen Royal Infirmary O Union Terrace O Aberdeen Bus Station Service 10 Inverness to Aberdeen Operator: Stagecoach

This chapter focuses entirely on recommendations for students, staff, faculty, researchers, and leaders of small, elite, liberal arts institutions to minimize the academic

consequence, the management decided to consider a promotion to Director of Sales and Marketing for the Asia-Pacific region. He would succeed his current boss who was supposed to

Accordingly, the fol- lowing were compared from the earliest available years: the annual numbers of first-time applicants with an MD, a PhD, and an MD and a PhD for traditional

Guilford County Department of Social Services—Innovations $ 84,000 This grant provides increased capacity for the provision of substance abuse and mental health treatment

In order to test our view that child molesters turn to children for sex, comfort and intimacy because they do not have the capacity necessary to meet these needs with adults,

Test certificate of the cement consignment s Shall be submitted to TE/GAIL and one lot of the cement shall be tested approved lab during designed mix.. 5.4

Webbey De Keyser Strobalenbouw Toen ik voor het eerst een artikel las over strobalenbouw in Wonen met de Natuur, het kwartaaltijdschrift van het Vlaams Instituut voor