Professional Documents
Culture Documents
ECNG3016 Practical 2
ECNG3016 Practical 2
ECNG 3016
ADVANCED DIGITAL ELECTRONICS
http://myelearning.sta.uwi.edu/course/view.php?id=686
Semester II 2009/2010
1.
GENERAL INFORMATION
Lab #:
Name of the Lab:
Practical 2
Frequency Division and Time Multiplexing of Displays
Lab Weighting:
0%
Delivery mode:
Lecture
Online
Lab
Other
Microprocessor Laboratory
Lab Dependencies2
Recommended
prior knowledge
and skills3:
Course Staff
Position/Role
Estimated total
study hours1:
Cathy Radix
Lecturer
E-mail
Cathy.Radix@sta.uwi.tt
Azim Abdool
Instructor
azim.abdool@sta.uwi.tt
Phone
Office
Office
Hours
x3157 Rm 321, Mon/Tue
11am Blk 1
2pm
x2636 Rm 341/ Mon/
RTSG,
Thu
Blk 1
11am12pm
2.
Upon successful completion of the lab assignment, students will be able to:
1. Understand the concepts of frequency division and time multiplexing of
displays
2. Design and implement a frequency divider in VHDL to meet a required
specification
3. Design and implement a Time Multiplexing display unit to meet a required
specification using a simple state machine architecture
3. PRE-LAB
Due Date:
Submission
Procedure:
Estimated time to
completion:
Cognitive
Level
C
Ap
Ap
Write a frequency divider module that has an interface taking an input clock signal of 50MHz and
outputting a divided signal of 1kHz as well as 1Hz.
1. The frequency divider would implement the following given algorithm to produce a 1kHz
signal.
frequency_divider_ms(clock)
temporary variable cnt defined from 0 to 25000
begin
if a rising edge of input clock is detected
Increment cnt
if cnt = 25000 then
cnt 0
The frequency divider would implement the following second algorithm to obtain the 1Hz clock
signal.
frequency_divider_s(clock)
temporary variables i and j defined from 0 to 5000
begin
if a rising edge of input clock is detected
increment i
if i = 5000 then
i 0
increment j
if j = 5000 then
j 0
toggle output clock signal
end if
end if
end if
end frequency_divider_s
2. For time multiplexing of displays, we switch on a particular display while keeping all others
off. Given that on the Spartan 3 development board, there exists 4, active low, common
anode connected seven segment displays; draw a state diagram depicting a 4 bit output of a
controller unit.
4.
IN-LAB
Select VHDL Synthesis Constructs Coding Examples State Machines Moore (Figure 2).
Follow the commented steps within the language template in order to code the state machine
architecture that was devised in the pre-lab. This would be a simple Moore state machine in VHDL
to look up the particular states of the anodes.
Synthesize your result and ensure that it builds correctly.
Add your frequency divider source that was created during the pre-lab to the current project. Ensure
that it gives no syntactual errors.
Note that the connection between the encode_anodes component and the adder_3bits component
entail a 2 bit output going to a 3 bit input. The 2 bit output of encode_anodes should be connected to
the two less significant bits of the input of adder_3bits and the uppermost bit grounded off/cleared.
8
After finishing the creation of the scrolling_msg_system, implement it using the pin constraints
given in Table 1.
Table 1: Pin Constraints
Design Port
clock
reset
clock_enable
anodes(0)
anodes(1)
anodes(2)
anodes(3)
sseg(0)
sseg(1)
sseg(2)
sseg(3)
sseg(4)
sseg(5)
sseg(6)
T9
any available pushbutton
any available switch
D14
G14
F14
E13
E14
G13
N15
P15
R16
F13
N16
5.
POST-LAB
Due Date:
Submission
Procedure:
Deliverables:
Not Applicable
-
10
6.
Since the display is composed of LEDs, which need high current to drive them, power
consumption is very critical. Consider a panel with 4 displays and the number to be displayed is
8888. Each LED needs 20 mA. So we need a current of 20x7x4 = 560 mA. Thats a lot of current
compared to the current consumed by the microprocessor. Another problem is the number of
components and output bits that are needed to connect the displays to the processor. We need at
least 4x7 = 28 resistors and 28 output bits for the 4 displays. Is there a solution for these
problems? Yes, there is, its called MULTIPLEXING!
The Pegasus board contains a four-digit common anode seven-segment LED display. The
display is multiplexed, so only seven cathode signals exist to drive all 28 segments in the
display. Four digit-enable signals drive the common anodes and these signals determine which
digit the cathode signals illuminate Figure 5.
11
This connection scheme creates a multiplexed display, where driving the anode signals and
corresponding cathode patterns of each digit in a repeating, continuous succession can create the
appearance of a four-digit display. Each of the four digits will appear bright and continuously
illuminated if the digit enable signals are driven low once every 1 to 16ms (for a refresh
frequency of 1KHz to 60Hz). For example, in a 60Hz refresh scheme, each digit would be
illuminated for one quarter of the refresh cycle, or 4ms. The controller must assure that the
correct cathode pattern is present when the corresponding anode signal is driven (Figure 6).
However, this represents the cathode pattern for the shown for the given connection pattern.
These patterns would change for different connection patterns.
To illustrate the process, if AN0 is driven low while CB and CC are driven low, then a "1"
will be displayed in digit position 0. Then, if AN1 is driven low while CA, CB and CC are
driven low, then a "7" will be displayed in digit position 1. If A1 and CB, CC are driven for 4ms,
and then A2 and CA, CB, CC are driven for 4ms in an endless succession, the display will show
"17" in the first two digits. Figure 7 shows the pattern of decimal digit.
12
13