top of page
FOLLOW ME
  • Black Facebook Icon

Tutorial 3 : Using ZedBoard UART

  • Writer: Ahmed Mohamed
    Ahmed Mohamed
  • Mar 3, 2018
  • 3 min read

Introduction

During this tutorial we are going to use ZYNQ SOC to send data from the ZedBoard to PC using UART, the Zedboard PS contains 2 UART peripherals with default baud rate set to 115200. Both UART1 and UART2 are part of the IOP and can be connected to the package pins through the multiplexed input output block (MIO) or the extended multiplexed input output (EMIO).

The IOP block contains a number of popular peripherals, SPI, I2C, UART …. Etc. each of these peripherals can be connected to a dedicated block with 54 package pins through a multiplexed input output block, if we used too many of these peripherals, the 54 pins will not be enouph this can be solved by the extended multiplexed input output EMIO, which routes the signals to the PL of the ZYNQ and through the PL it can be connected to Pins dedicated for the PL or it can be used by internal design in the PL




Step1: Create new project using Vivado IDE

Create new project with the name of Zedboard_tutorial3

Step2: Create Block design

In this project we will need to ass 2 GPIO IP’s the first one is for the input switches and the second one would be for the output LEDs these IPs will be connected to the ZYNQ processing system

1. In the Flow Navigator click expand the IP Integrator and click create block design, create Design window will pop up, keep the same name design_1 and click ok.

2. Add ZYNQ processing system and run block automation.


Note: Double click on the ZYNQ processing system, the ZYNQ re-customization window will open and you can see all the ZYNQ peripherals and internals, to the left there is the IOP block, by default the UART1 is selected, if you click on it you will see that it is connected to the MIO pin 48 and 49 which is connected to the USB-UART chip on the Zedboard, this can be changed to another MIO pins or can be connected to the PL EMIO.

3. Add AXI GPI and configure it to leds 8 bits (refer to tutorial 1) then run connection automation and select all automation. The final design is shown in figure 3

figure 3

4. In the sources window, right click on the design_1 block design under Design Source folder and choose create HDL wrapper then click on generate bitstream or click on flow->generate bitstream.

5. Bit Generation Complete window should pop up, close it then go to File-> Export -> Export Hardware. Check the Include bitstream and click ok. This exports the hardware files generated to the SDK (software development kit).


Step3: writing the software application

1. In Vivado go to File-> Launch SDK, the SDK will open and in the Project Explorer window you can see the exported hardware files. In the SDK go to Files-> New-> board support package then click finish, this create a board support package with all necessary functions for driving the hardware you designed in Vivado.

2. Create application project by going to File-> Application Project, in the project name type Project1 and in the board support package choose use existing then click Next and choose Hello World from the available templates then click finish

3. Expand the src folder under the Project1 folder and double click on Helloworld.c and replace it with the following code



4. The function is an optimized version of the function printf which is optimized for the Xilinx devices, the function


Step4: Programming the Zedboard and running the C Application

  1. In the SDK click on the program FPGA icon then click program to program the ZYNQ PL with the bitstream.

  2. Write click on Project1 in the project explorer then go to Run AS-> 4 Launch on Hardware(GBD). The application should run on the board and the LEDs will read the value of the switches.

  3. Use TeraTerm software available at: http://download.cnet.com/Tera-Term/3000-20432_4-75766675.html

  4. Open the TeraTerm and choose serial, connect to the Zedboard and set the baudrate to 115200, now when you press any number on the terminal you would see its binary value on the LEDs and the and the number will be also seen on the terminal.

Subscribe to get upcoming FPGA projects by email

SEARCH BY TAGS
FEATURED POSTS
bottom of page