FPGA pushbutton lights LED

Overview

PyPi module N/A
git repository https://bitbucket.org/arrizza-public/fpga-pushbutton-led
git command git clone git@bitbucket.org:arrizza-public/fpga-pushbutton-led.git
Verification Report https://arrizza.com/web-ver/fpga-pushbutton-led-report.html
Version Info
  • Ubuntu 20.04 focal, Python 3.10

Summary

CMODA7 FPGA turn on an LED when the pushbutton is pressed. See https://arrizza.com/fpga for prerequisites and setup.

Note: original code is from https://digilent.com/reference/learn/software/tutorials/verilog-project-2/start

To install

  • clone the repo
  • Open Vivado
  • click Open Project
  • navigate to the repo and select the .xpr file

Settings

  • select Settings (blue cogwheel)
    • select Tool Settings | Project
    • in Default Project Directory, select "Specify project directory" and select the directory for this project
    • click OK

To program and run

  • find "SYNTHESIS" in left hand pane
    • click "Run Synthesis" next to Green arrow
    • see upper right corner in menu bar for status e.g. "running synth_design" with a cycling green circle
    • takes 1-2m
  • get dialog box "Synthesis Completed"
    • ensure "Run Implementation" selected
    • click OK
  • get dialog box "Launch Runs"
    • set Number of jobs to the number of cores your PC has (e.g. 8)
    • click OK
    • see upper right corner in menu bar for status e.g. "initializing Design" with a cycling green circle
    • takes 1-2m
  • get dialog box "Implementation Completed"
    • select "Generate Bitstream"
    • click OK
  • get dialog box "Launch Runs"
    • click OK
    • see upper right corner in menu bar for status e.g. "Running write_bitstream" with a cycling green circle
    • takes 1-2m
  • get dialog box "Bitstream Generation Completed"
    • select "Open Hardware Manager"
    • if No hardware target is open:
      • ensure your FPGA is connected via USB-micro and powered on
      • click "Open Target" either in left hand pane or in green bar at top of window
      • get a dropdown menu
      • click "Auto Connect"
      • get dialog box, takes 5 - 10s
      • Hardware pane should have your FPGA in it and indicate "Connected"
  • there should be a new item "Program device" in the left hand pane and in the the green bar at top of window
    • click "Program device"
    • get dialog box "Program Device"
    • click "Program"
    • takes 1-2s

To test

  • There are 2 buttons on the FPGA board BTN0 and BTN1
  • There are 3 LEDs: LD0, LD1 and LD2

    • LD0 is a tri-color led and should be lit (blue)
    • LD1 and LD2 are off (both green)
  • press BTN0 => LD1 should turn on

  • release BTN0 => LD1 should turn off

    • LD0 should stay lit (blue) and LD2 be off
  • press BTN1 => LD2 should turn on

  • release BTN1 => LD2 should turn off

    • LD0 should stay lit (blue) and LD1 be off
  • press both BTN0 and BTN1 => both LD1 and LD2 should turn on

  • release both buttons => both LEDs should turn off

- John Arrizza