Anda di halaman 1dari 7

THE UNIVERSITY OF THE WEST INDIES

ST. AUGUSTINE, TRINIDAD & TOBAGO, WEST INDIES


FACULTY OF ENGINEERING
Department of Electrical & Computer Engineering

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 5
Using the Picoblaze Softcore to Control 7-Segment Displays

Lab Weighting:

35%

Delivery mode:

 Lecture
 Online
 Lab
 Other

Venue for the Lab:

Microprocessor Laboratory

Lab Dependencies2

The theoretical background to this lab is provided in ECNG 3016


Theoretical content link: given at top of page
Pre-Requisites ECNG 2004
To undertake this lab, students should be able to:
1. Use Xilinx ISE in the implementation of digital systems
2. Describe Digital Systems using VHDL, in particular: write VHDL
code to a specified algorithm; create variables, signals and
components; and structurally map together an entity out of multiple
instantiated components

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

Practical 5: Using the Picoblaze Softcore to Control 7-segment Displays

2.

LAB LEARNING OUTCOMES

Upon successful completion of the lab assignment, students will be able to:
1. Understand characteristics of the PicoBlaze soft-core microprocessor.
2. Use the PicoBlaze soft-core microprocessor the implementation of a small
scale digital system on a Spartan 3 FPGA

3. PRE-LAB
Due Date:
Submission
Procedure:
Estimated time to
completion:

Cognitive
Level
C
Ap

N/A (To be completed in advance of in-lab session)


N/A
2 hours

3.1. Required Reading Resources


1. PicoBlaze 8-bit Embedded Microcontroller User Guide for Spartan-3, Virtex-II, and Virtex-II
Pro FPGAs(UG129 (v1.1.1) November 21, 2005) labelled as PicoBlaze User Guide.pdf
on MyeLearning.
2. KCPSM3 8-bit Micro-controller User Guide for Spartan-3, Virtex-II, and Virtex-II Pro
FPGAs, by Ken Chapman. Xilinx Ltd, 0ctober 2003, rev 7 labelled as
KCPSM3_Manual.pdf on MyeLearning.

Practical 5: Using the Picoblaze Softcore to Control 7-segment Displays

3.2 Pre-Lab Exercise: Reading and Analyzing Exercise

Characteristics of the PicoBlaze Soft-core Microprocessor


Use the Picoblaze User Guide from the course support website to answer the following questions.

1. How many possible inputs and outputs can the PicoBlaze microprocessor provide? Explain
your answer.

2. What is the range of clock (clk) frequencies that the PicoBlaze microprocessor can operate at?

3. What is the significance of the READ_STROBE port of the PicoBlaze microprocessor?

Practical 5: Using the Picoblaze Softcore to Control 7-segment Displays

4.

IN-LAB

Allotted Completion 3 hours


Time:
1 Computer
Required lab
1 Spartan 3 Toolkit
Equipment:
4.1. In-Lab Procedure
Figure 3 below gives the block diagram of the PicoBlaze microprocessor in a connection
with the seven segment display. For this lab, we will take the 4-bit binary value given by four of
the switches on the Spartan 3 board and display its hex representation on a single 7-segment
output. View the interconnections as shown by Figure 1. Using the diagram as a guide, compose a
simple algorithm that would take the value at the input port of the Picoblaze and write out the
value to the output port
1. Download the KCPSM3 Resources from the course support website.
2. Unzip/extract the folder KCPSM3.rar.
3. Open Xilinx ISE webpack and create a new project called PicoBlaze_SSeg.
4. Click Add Copy of Source and browse to the \KCPSM3\VHDL directory from the online
resources and select kcpsm.vhd. Click Open and then OK to add kcpsm3.vhd as a VHDL
Design File to the project.
5. Download the pBlazeIDE environment from the course support website.
6. Using the pBlazeIDE.exe environment, write the assembly code for the ROM to be connected
to the PicoBlaze microprocessor.
7. Search the KCPSM3 folder for a folder named Assembler. Save the assembly code as
pico_rom.psm, in the folder named Assembler. (Note: the name of the .psm file must not
exceed 8 characters)
8. Assemble and Simulate your assembly code in the pBlazeIDE.exe environment.
9. Open up the Command Prompt by going to Start  Programs  Accessories 
Command Prompt.
10. Browse to the Assembler directory using the cd command as shown below:
>cd \KCPSM3\Assembler
11. Enter the following command at the command prompt to assemble the code and generate the
output program ROM files.
>kcpsm3 pico_rom.psm

Practical 5: Using the Picoblaze Softcore to Control 7-segment Displays

This will create VHDL and Verilog files which provide the behaviour given by the assembly
code written in pBlazIDE.exe.
12. Click Add Copy of Source and browse to \KCPSM3\Assembler and select pico_rom.vhd.
Click Open and then OK to add pico_rom.vhd as a VHDL Design File to the project.
13. Implement the Picoblaze 7-segment system
14. Interface system modules together in a VHDL module named PicoBlaze_SSeg_Main.vhd. Use
the block diagram of Figure 1 as your guide. Remember to hard-code the anodes to turn on a
single anode.
15. Create an implementation constraints file for the system.
16. Connect the Spartan 3 development board to the LCD. Download the bitstream to the Spartan
3 FPGA development board and perform on-board testing on the system.

Figure 1: Picoblaze Connections

Compare the above to what was done for Lab 2, where we turned on the seven segment displays
using hardware modules only without a processor. Which method do you prefer?

Practical 5: Using the Picoblaze Softcore to Control 7-segment Displays

Proceed to post-lab exercise.

Practical 5: Using the Picoblaze Softcore to Control 7-segment Displays

5.

POST-LAB

A signed plagiarism declaration form must be submitted with your assignment.

Due Date:
Submission
Procedure:
Deliverables:

NA

5.1. Assignment:

Modify the processing unit to take an 8-bit input (all the switches) and multiplex the seven
segment displays using:
1. An instruction based delay
2. An externally created timer
a. Being polled
b. By interrupt
In order to do this, you may realize that you can utilize a demultiplexer on the write_strobe to
create more possible outputs, and a multiplexer on the input port to create more inputs, and
utilize the port_id port to serve as a selection line for the external demultiplexer and multiplexer.
You can see the input and output ports section of the Picoblaze User Guide on recommendations
when dealing with this. You can also view the interrupts section to see how you can deal with
these as well.

Anda mungkin juga menyukai