Introduction: Addressable LEDs on the Arty FPGA Board

About: Check out my up coming microcontroller board! www.redlemur.io

Addressable LEDs are fun to add to any project and can now to added to any Zynq or Microblaze design. The DigiLED FPGA IP core can be customized through a simple GUI and then writing patterns to the LEDs is simple with the included drivers.

Microblaze and Zynq designs can be a difficult projects so being familiar with one or both of these tutorials can be very useful:

Zynq Design Tutorial

Microblaze Design Tutorial

The prebuilt project in Vivado 2015.4 can be found here

Step 1: Adding IP Repository

The DigiLED IP core is an component that connects through the AXI interface to either a Zynq design or Microblaze design. First go and grab the IP so we can add it to Vivado

  1. Download the DigiLED ip core from here
  2. Copy the IP core to a workspace location on your computer
  3. Then click on "Project settings" in the left panel.
  4. In the new window that pops up, click on IP and click on the plus button to add the IP
  5. Browse the the workspace location that you saved the IP core to
  6. Click OK

Step 2: Build Microblaze Design

  1. Create Block Design
  2. Add IP blocks:
    1. Microblaze processor
    2. DigiLED
    3. AXI GPIO
  3. Run Block automation and increase the local memory of the Microblaze processor to 128KB
  4. Run Connection automation
  5. Change clock wizard to be single ended and reset active low
  6. Connect the GPIO core to the pushbuttons
  7. right-click the "led_out" and click "make external"
  8. double-click on the DigiLED core to customize it
  9. Select HSV color mode
  10. Change the number of LEDs so that Vivado calculates the address bus width and click OK
  11. Reopen the DigiLED custom window to double-check that Vivado saved the settings correctly.
  12. Create the HDL wrapper

If any of this is confusing then refer to the tutorials listed in the beginning

Step 3: Add XDC Constraint File and Connect

  1. Add the master Arty XDC from Digilent
  2. In the XDC, change this:

set_property -dict { PACKAGE_PIN V15 IOSTANDARD LVCMOS33 } [get_ports { ck_io[0] }]; #IO_L16P_T2_CSI_B_14 Sch=ck_io[0]

To this:

set_property -dict { PACKAGE_PIN V15 IOSTANDARD LVCMOS33 } [get_ports { led_out }]; #IO_L16P_T2_CSI_B_14 Sch=ck_io[0]

Step 4: Generate Bitstream, Export Hardware Design and Launch SDK

  1. Click Generate Bitstream in the left pain
  2. Go to File->Export->Export Hardware...
  3. Check the box to Include bitstream
  4. Go to File-> Launch SDK

Step 5: Add Application Project

  1. Go to File->New->Application Project...
  2. Give the project a good name
  3. Click next
  4. Select "Empty Project"
  5. Click Finish
  6. Add main.c file to src directory
  7. Connect the power line of the WS2812 LEDs to the 3.3V pin on the Arty
  8. Connect the ground line to the GND pin on the Arty
  9. Connect the data pin to IO 0 pin of the Arty.
  10. Expand Debug directory and right click the .elf file
  11. Click Run As..-> Launch on Hardware (GDB)

Now the design should be running and you should be able to change patterns with BTN0

Attachments