element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project Videos
  • Challenges & Projects
  • element14 presents
  • Project Videos
  • More
  • Cancel
Project Videos
Documents Program Your Own FPGA Video Game -- Episode 353
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Project Videos to participate - click to join for free!
Related
Recommended
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 2 Aug 2018 4:48 PM Date Created
  • Last Updated Last Updated: 3 Aug 2018 7:24 AM
  • Views 5312 views
  • Likes 20 likes
  • Comments 17 comments

Program Your Own FPGA Video Game -- Episode 353

image
Program Your Own FPGA Video Game

element14 Presents  |  Andy West's VCP Profile |  Project Videos

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

In this video, we learn how to make a retro-style table tennis game with an FPGA. We take a look at the DE0-Nano development board, along with Altera's Quartus II design software. We also learn about the Verilog language and dive into some code. Finally, with the help of some additional components, we interface directly with a VGA monitor and an NES game controller.

 

 

Product NameQuantity
Buy Kit

P0082 -  Development Kit, FPGA, DE0-Nano, 2x GPIO Headers, 32MB RAM, Accelerometer

1Buy Now

GS-630A -  Breadboard, ABS, 56 mm x 136 mm x 10 mm

1Buy Now

1739 -  Large Enclosed Piezo Element w/Wires

1Buy Now

OS-9975 -  Replacement NES Wired Controller

1Buy Now

Sub Connector High Density 15 Contacts Receptacle DE High Density Series Metal Body Solder

1Buy Now

826 -  Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)

1Buy Now
MC001810 -  Jumper Wire Kit, Multicolor, 2 mm - 125 mm, 22 AWG, 140 Piece1Buy Now
Female NES Controller Connector1
270 Ohm Through Hole Resistor3Buy Now

 

Click Herefor access to all the supporting files you will need to replicate this build!
  • fpga development
  • programmablelogicch
  • nes controller
  • 270 ohm through hole resistor
  • pong
  • piezo element
  • fpga development board
  • fpga
  • breadboard
  • vcpfpga
  • piezo
  • de0-nano
  • nes wired controller
  • field programmable gate arrays
  • female nes controller connector
  • d sub connector
  • vcp
  • e14presents_andywest
  • friday_release
  • jumper wires
  • Share
  • History
  • More
  • Cancel
Actions
  • Share
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • DAB
    DAB over 7 years ago +2
    Nice introduction to the internal part of an FPGA. I liked the walk through of the software and how to build the hardware descriptions. DAB
  • jomoenginer
    jomoenginer over 7 years ago +2
    Oh, cool! A Ben Heck cameo. This is really cool. I've been meaning to create a FPGA game so this might be a great place to start. Yeah, I know some FPGA folks that hate being called Software Engineers…
  • baldengineer
    baldengineer over 7 years ago +2
    Nicely done on your tutorial. FPGAs are that next-level factor that I think many electronics enthusiasts and professionals need. I think it was clever to combine teaching about them with an NES controller…
Parents
  • gsharpe
    gsharpe over 6 years ago

    Great video!  I learned quite a bit while recreating the project on my board and, as luck would have it, ran into a problem when trying to make use of a cheap knockoff version of the NES controller.  I found that when pressing the right arrow button, it would register both the right arrow (last bit of the shift register) AND the 'a' button (first bit of the shift register).  With the original project timing for the controller, I tried to investigate the knockoff's strange behavior.  When pressing the 'a' button, it appeared to asynchronously latch properly as would be done with the CD4021 shift register of the original controller, but if the right arrow was pressed, the output remained low through the next latch pulse and the output would not change until the first clock pulse rising edge when the 'b' button value shifted out.  I still don't know why it behaves this way, but I found two methods for a workaround.  The first and simplest is by setting the 'CONTROLLER_PULSE <= 1;' in the idle state of the NesController.v file's state machine, so that the clock signal is normally high.  The other way that worked was to add another state which added an extra clock pulse.  Either way just meant there were eight rising edges instead of seven for each readout and this works for both the original and knockoff versions.  I hope this helps anyone who encounters this issue!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • gsharpe
    gsharpe over 6 years ago

    Great video!  I learned quite a bit while recreating the project on my board and, as luck would have it, ran into a problem when trying to make use of a cheap knockoff version of the NES controller.  I found that when pressing the right arrow button, it would register both the right arrow (last bit of the shift register) AND the 'a' button (first bit of the shift register).  With the original project timing for the controller, I tried to investigate the knockoff's strange behavior.  When pressing the 'a' button, it appeared to asynchronously latch properly as would be done with the CD4021 shift register of the original controller, but if the right arrow was pressed, the output remained low through the next latch pulse and the output would not change until the first clock pulse rising edge when the 'b' button value shifted out.  I still don't know why it behaves this way, but I found two methods for a workaround.  The first and simplest is by setting the 'CONTROLLER_PULSE <= 1;' in the idle state of the NesController.v file's state machine, so that the clock signal is normally high.  The other way that worked was to add another state which added an extra clock pulse.  Either way just meant there were eight rising edges instead of seven for each readout and this works for both the original and knockoff versions.  I hope this helps anyone who encounters this issue!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • andywest
    andywest over 6 years ago in reply to gsharpe

    Hey, gsharpe! It's always great to hear from people trying the project themselves. Thanks for sharing your experience using an unofficial NES controller. I also used a "replacement" controller. I wonder if anyone has tried an original, 30-year-old gamepad? Anyway, glad to hear you enjoyed the video and thanks again for sharing these workarounds with the community!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube