Digital Systems - Chapter10.pdf
(
686 KB
)
Pobierz
CHAPTER 10
DIGITAL SYSTEM
PROJECTS USING HDL
■
OUTLINE
10-1
Small-Project Management
10-4
Digital Clock Project
10-2
Stepper Motor Driver
Project
10-5
Frequency Counter Project
10-3
Keypad Encoder Project
■
OBJECTIVES
Upon completion of this chapter, you will be able to:
■
Analyze the operation of systems made of several components that
have been covered earlier in this textbook.
Describe an entire project with one HDL file.
■
Describe the process of hierarchical project management.
■
Understand how to break a project into manageable pieces.
■
Use or Quartus II software tools to implement a hierar-
chical modular project.
MAX + PLUS
II
■
Plan ways to test the operation of the circuits you build.
■
■
INTRODUCTION
Throughout the first nine chapters of this book, we have explained the fun-
damental building blocks of digital systems. Now that we have taken out
each block and looked it over, we do not want to put them all away and for-
get them; it is time to build something with the blocks. Some of the exam-
ples we have used to demonstrate the operation of individual circuits are
really digital systems in their own right, and we have studied how they
work. In this chapter, we want to focus more on the building process.
Surveys of graduates show us that most of the professionals in the elec-
trical and computer engineering and technology field have the responsibil-
ity of project management. Experience with students has also shown us
that the most efficient way to manage a project is not intuitively obvious to
everyone, which explains why so many of us end up attending the school of
hard knocks (learning through trial and error). This chapter is intended to
give you a strategic plan for managing projects while learning about digital
systems and the modern tools used to develop them. The principles here
are not limited to digital or even electronic projects in general. They could
apply to building a house or building your own business. They will defi-
nitely improve your success rate and reduce the frustration factor.
Hardware description languages were really created for the purpose
of managing large digital systems: for documentation, simulation testing,
and the synthesis of working circuits. Likewise, the Altera software tools
are specifically designed to work with managing projects that go far be-
yond the scope of this text. We will describe some of the features of the
Altera software packages as we go through the steps of developing these
small projects. This concept of modular project development, which was
introduced in Chapter 4, will be demonstrated here through a series of
examples.
677
678
C
HAPTER
10/
D
IGITAL
S
YSTEM
P
ROJECTS
U
SING
HDL
10-1
SMALL-PROJECT MANAGEMENT
The first projects described here are relatively small systems that consist of
a small number of building blocks. These projects can be developed in sep-
arate modules, but this approach would only add to the complexity. They are
small enough that it makes sense to implement the entire project in a sin-
gle HDL design file. This does not mean, however, that a structured process
should
not
be followed to complete the project. In fact, most of the same
steps that should be employed in a large modular project are also applica-
ble in these examples. The steps that should be followed are (1) overall def-
inition, (2) strategic planning to break the project into small pieces, (3) syn-
thesis and testing of each piece, and (4) system integration and testing.
Definition
The first step in any project is the thorough definition of its scope. In this
step, the following issues should be determined:
How many bits of data are needed?
■
How many devices are controlled by the outputs?
■
What are the names of each input and output?
■
Are the inputs and outputs active-HIGH or active-LOW?
■
What are the speed requirements?
■
Do I understand fully how this device should operate?
■
What will define successful completion of this project?
■
From this step should come a complete and thorough description of the over-
all project’s operation, a definition of its inputs and outputs, and complete
numeric specifications that define its capabilities and limitations.
Strategic Planning
The second step involves developing a strategy for dividing this overall proj-
ect into manageable pieces. The requirements of the pieces are:
A way to test each piece must be developed.
■
Each piece must fit together to make up the whole system.
■
We must know the nature of all the signals that connect the pieces.
■
The exact operation of each block must be thoroughly defined and un-
derstood.
■
We must have a clear vision of how to make each block work.
■
This last requirement might seem obvious, but it is amazing how many proj-
ects are planned around one central block that involves a not-yet-discovered
technical miracle or violates silly little laws like conservation of energy. In
this stage, each subsystem (section block) becomes somewhat of a project in
and of itself, with the possibility of additional subsystems defined within its
boundaries. This is the concept of hierarchical design.
Synthesis and Testing
Each subsystem should be built starting at the simplest level. In the case of
a digital system designed using HDL, it means writing pieces of code. It also
679
S
ECTION
10-2/
S
TEPPER
M
OTOR
D
RIVER
P
ROJECT
means developing a plan for testing that code to make sure it meets all the
criteria. This is often accomplished through some sort of simulation. When a
circuit is simulated on a computer, the designer must create all the different
scenarios that will be experienced by the actual circuit and must also know
what the proper response to those inputs should be. This testing often takes
a great deal of thought and is not an area that should be overlooked. The
worst mistake you can make is to conclude that a fundamental block works
perfectly, only to find later those few situations where it fails. This predica-
ment often forces you to rethink many of the other blocks, thus nullifying
much of your work.
System Integration and Testing
The last step is to put the blocks together and test them as a unit. Blocks are
added and tested at each stage until the entire project is working. This area
is often trivialized but rarely goes smoothly. Even if you took care of all the
details you thought about, there are always the “gotchas” that nobody
thought about.
Some aspects of project planning and management go beyond the scope
of this text. One is the selection of a hardware platform that will best fit your
application. In Chapter 13, we will explore the broad field of digital systems
and look specifically at the capabilities and limitations of PLDs in various
categories. Another very critical dimension in project management is time.
Your boss will give you only a certain amount of time to complete your proj-
ect, and you must plan your work (and effort) to meet this deadline. We will
not be able to cover time management in this text, but as a general rule you
will find that most facets of the project will actually take two to three times
longer than you think they will when you begin.
REVIEW QUESTIONS
1. Name the steps of project management.
2. At what stage should you decide how to measure success?
10-2
STEPPER MOTOR DRIVER PROJECT
The purpose of this section is to demonstrate a typical application of coun-
ters combined with decoding circuits. A digital system often contains a
counter that cycles through a specified sequence and whose output states
are decoded by a combinational logic circuit, which in turn controls the op-
eration of the system. Many applications also have external inputs that are
used to put the system into various modes of operation. This section dis-
cusses all these features to control a stepper motor.
In a real project, the first step of definition often involves some research
on the part of the project manager. In this section (or project), it is vital that
we understand what a stepper motor is and how it works before we try to cre-
ate a circuit that is supposed to control it. In Section 7-10, we showed you
how to design a simple synchronous counter that could be used to drive a
stepper motor. The sequence demonstrated in that section is called th
e
full-
step sequence.
As you recall, it involved two flip-flops and their
Q
and out-
puts driving the four coils of the motor. The full-step sequence always has
two coils of the stepper motor energized in any state of the sequence and
typically causes
Q
15°
of shaft rotation per step. Other sequences, however, will
680
C
HAPTER
10/
D
IGITAL
S
YSTEM
P
ROJECTS
U
SING
HDL
also cause a stepper to rotate. If you look at the full-step sequence, you will
notice that each state transition involves turning off one coil and simultane-
ously turning on another coil. For example, look at the first state (1010) in
the full-step sequence of Table 10-1. When it switches to the second state in
the sequence,
coil 1
is turned off and
coil 0
is turned on. The
half-step sequence
is created by inserting a state with only one coil energized between full
steps, as shown in the middle column of Table 10-1. In this sequence, one coil
is de-energized before the other is energized. The first state is 1010 and the
second state is 1000, meaning that
coil 1
is turned off for one state before
coil
0
is turned on. This intermediate state causes the stepper shaft to rotate half
as far as it would in the full-step sequence The half-step se-
quence is used when smaller steps are desirable and more steps per revolu-
tion are acceptable. As it turns out, the stepper motor will rotate in a manner
similar to the full-step sequence ( per step) if you apply only the sequence
of intermediate states with one coil energized at a time. This sequence, called
the
wave-drive sequence,
has less torque but operates more smoothly than the
full-step sequence at moderate speeds. The wave-drive sequence is shown in
the right-hand column of Table 10-1.
(7.5°)
(15°).
15°
TABLE 10-1
Stepper motor
coil drive sequences.
Full-Step
Half-Step
Wave-Drive
1010
1010
1000
1000
1001
1001
0001
0001
0101
0101
0100
0100
0110
0110
0010
0010
Problem Statement
A microprocessor laboratory needs a universal interface to drive a stepper
motor. In order to experiment with microcontrollers driving stepper motors,
it would be useful to have a single universal interface IC wired to the step-
per motor. This circuit needs to accept any of the typical forms of stepper
drive signals from a microcontroller and activate the windings of the motor
to make it move in the desired manner. The interface needs to operate in one
of four modes: decoded full-step, decoded half-step, decoded wave-drive, or
nondecoded direct drive. The mode is selected by controlling the logic levels
on the
M1, M0
input pins. In the first three modes, the interface receives just
two control bits—a step pulse and a direction control bit—from the micro-
controller. Each time it sees a
rising
edge on the step input, the circuit must
cause the motor to move one increment of motion clockwise or counterclock-
wise, depending on the level present on the direction bit. Depending on the
mode that the IC is in, the outputs will respond to each step pulse by chang-
ing state according to the sequences shown in Table 10-1. The fourth mode of
operation of this circuit must allow the microcontroller to control each wind-
ing of the motor directly. In this mode, the circuit accepts four control bits
from the microcontroller and passes these logic levels directly to its outputs,
which are used to energize the stepper coils. The four modes are summarized
in Table 10-2.
Plik z chomika:
Januszek66
Inne pliki z tego folderu:
Back Seat_ A Mumbai Tale - Aditya Kripalani.mobi
(755 KB)
Brief Wondrous Life of Oscar Wao, The - Junot Diaz.opf
(3 KB)
Don't Make Me Think, Revisited_ - Steve Krug.mobi
(9256 KB)
M. T. Anderson - Norumbegan 03 - The Empire of Gut and Bone # (v5.0).epub
(2209 KB)
M. T. Anderson - Norumbegan 02 - The Suburb Beyond the Stars # (v5.0).epub
(2105 KB)
Inne foldery tego chomika:
Dokumenty
Galeria
LUDLUM ROBERT
Midi - Kar
Mszał Rzymski PL
Zgłoś jeśli
naruszono regulamin