Columbia CSEE 4840 - Embedded System Design Lab 1 (2 pages)

Previewing page 1 of 2 page document View the full content.
View Full Document

Embedded System Design Lab 1



Previewing page 1 of actual document.

View the full content.
View Full Document
View Full Document

Embedded System Design Lab 1

156 views


Pages:
2
School:
Columbia University
Course:
Csee 4840 - Embedded System Design
Embedded System Design Documents
Unformatted text preview:

Embedded System Design Lab 1 Stephen A Edwards Due August 2 2005 Abstract Write a C program that counts in decimal on the Digilent Spartan 3 starter board Learn how to compile and run a program program the FPGA and use serial communication for debugging 1 Introduction The Digilent Spartan 3 Starter Board consists of a Xilinx Spartan 3 XC3S400 FPGA which has roughly 400 000 raw gates that can be user programmed into any configuration For this lab you will use a project we have provided for you consisting of the Microblaze 32 bit microprocessor a UART and a soft peripheral that controls the seven segment LEDs on the board 2 Hello World First get familar with the tools by compiling and running the sample project supplied by Xilinx 1 The boards have a serial port on them and the sample project includes a UART Universal Asynchronous Receiver Transmitter that can be used to communicate through a modem cable to the workstation We will use this for debugging since it provides a way to print things from the C program 2 Unzip the lab1 source file on the class home page http www1 cs columbia edu sedwards classes 2005 emsys summer in the directory C edk user repository It should create a directory there named lab1 Start Hyperterminal and set it to use COM1 at 9600 baud no parity one stop bit 3 Start Xilinx Platform Studio by clicking on the system xmp file in the directory you just unzipped 1 4 Start the compilation process and download the program to the board by clicking on the download button in the platform studio application It s on the second row of icons roughly in the middle You can also use the Tools Download menu item There are two interesting tabs in Platform Studio System which describes the hardware and peripherals and Applications which describes the software that runs on this hardware The demo project is centered around a single CPU microblaze 0 The Microblaze is Xilinx s own soft processor core specifically designed to be placed on an FPGA It is a 32 bit RISC style processor Fortunately the C compiler for it is good enough so that you do not have to know Microblaze assembly language to build an interesting project Under the CPU are three busses mb opb which is the peripheral bus ilmb which is the instruction bus and dlmb which is the data bus the Microblaze uses a Harvard architecture Connected to these busses are various bus controllers dlmb cntlr ilmb cntlr an on chip shared instruction and data memory block lmb bram a serial controller RS232 a driver for the row of LEDs LEDs 8Bit a controller for the off chip SRAM SRAM 256Kx32 util bus split 0 as well as a timer and interrupt controller The system mhs file lists how the hardware should be assembled to create the project For example it lists the LED and serial connections the Microblaze processor the UART and the peripheral that controls the LEDs The system mss file describes how the software should be assembled for the system and is less interesting than mhs file It says to include the UART driver and to connect stdin and stdout of the program to the driver The testApp c file under Applications Project TestApp Sources contains the main function that is run when the system is downloaded You will modify this for this lab The data system ucf lists to what pins on the FPGA internal signals should be connected These pin numbers came from the Digilent board documentation which lists the role s of each pin Finally etc bitgen spartan3 ut sets some options for generating the final bitstream This takes a long time and generates lots of harmless messages and over a thousand temporary files but will eventually compile the project into a bit file suitable for the FPGA on the board and finally download it 5 If all goes well the project will be compiled downloaded and run on the board The LEDs should glow for a while and finally a series of things should appear in Hyperterminal and the LEDs should start walking If something goes wrong make sure your board is connected properly it should have a power connection from the external power supply a connection through a parallel cable and a connection through a serial cable and powered on An LED near the power connector lights whenever power is applied to the board 4 If you can t get things to work pester someone for help 3 The Assignment Modify the testApp c file to count in decimal from 0 to 99 on the LEDs Make sure the numbers from 0 9 don t display a leading 0 Show your working counter to a TA have him sign a printout of your solution i e testApp c and hand that in Shorter elegant and readable solutions will be scored higher than ones that merely work What is going on A lot The Xilinx Platform Studio tool is assembling and compiling a small computer system that is then downloaded to the FPGA Platform Studio also compiles a small C program and downloads it into memory on the FPGA Finally it runs the program which prints things to the serial port and blinks the LEDs 2


View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Embedded System Design Lab 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Embedded System Design Lab 1 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?