Introduction: Addressable LEDs on the Arty FPGA Board
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:
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
- Download the DigiLED ip core from here
- Copy the IP core to a workspace location on your computer
- Then click on "Project settings" in the left panel.
- In the new window that pops up, click on IP and click on the plus button to add the IP
- Browse the the workspace location that you saved the IP core to
- Click OK
Step 2: Build Microblaze Design
- Create Block Design
- Add IP blocks:
- Microblaze processor
- DigiLED
- AXI GPIO
If any of this is confusing then refer to the tutorials listed in the beginning
Step 3: Add XDC Constraint File and Connect
- Add the master Arty XDC from Digilent
- 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
- Click Generate Bitstream in the left pain
- Go to File->Export->Export Hardware...
- Check the box to Include bitstream
- Go to File-> Launch SDK
Step 5: Add Application Project
- Go to File->New->Application Project...
- Give the project a good name
- Click next
- Select "Empty Project"
- Click Finish
- Add main.c file to src directory
- Connect the power line of the WS2812 LEDs to the 3.3V pin on the Arty
- Connect the ground line to the GND pin on the Arty
- Connect the data pin to IO 0 pin of the Arty.
- Expand Debug directory and right click the .elf file
- Click Run As..-> Launch on Hardware (GDB)
Now the design should be running and you should be able to change patterns with BTN0
2 Comments
4 years ago
Thanks for the tutorial. I used it along with some others to implement the DigiLED driver for the Zedboard. But I found an error in the DigiLED IP core - the default refresh rate is too small - 2000ps, or 20us. Even the 50us from the datasheet was too short; I had to increase the refresh rate to 100us to get the LEDs to work. Just FYI for anyone else trying to use this IP core for their LED project.
5 years ago
Great tutorial, but when I add the .C file to the xSDK, I get one error at line 156
void print(char *str);
Conflicting types for Print...
Any thoughts?