element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
Digital Fever
  • Challenges & Projects
  • Project14
  • Digital Fever
  • More
  • Cancel
Digital Fever
Blog Vidor Music Jukebox
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Digital Fever requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: zst123
  • Date Created: 2 Apr 2021 10:26 AM Date Created
  • Views 426 views
  • Likes 11 likes
  • Comments 3 comments
  • arduino mkr vidor 4000
  • mkr vidor 4000
  • digitalfeverch
Related
Recommended

Vidor Music Jukebox

zst123
zst123
2 Apr 2021

Vidor Music Jukebox

I'm proud to share my music jukebox project using the Arduino MRK Vidor 4000. It is my first project entirely using Verilog HDL!

 

Hardware Build

These are my connections on a breadboard.

After that I soldered it onto a veroboard to make it permanent.

 

Here's a block diagram schematic of how it works.

Some setbacks faced

 

To start off, I was too adventurous and spoilt the Wifi module. When configuring the serial port RX/TX pins, I could communicate with the Wifi NINA module. After that, I added SPI pins and messed up the directions by assigning one of the pins in the wrong order. Due to my mistake, 2 output pins were directly assigned together and damaged the Wifi NINA module. Now the module does not respond anymore, it is completely dead.

 

In the PCB schematic, the pins were wired directly from the FPGA to the Wifi Module without resistors. Maybe the Arduino team can improve on this and make it more fool-proof. If 2 outputs are configured together, a resistor should help to limit the current and prevent damage. Anyway, after ruining the Wifi module. I decided not to touch the Arduino code anymore, I'll make all the microcontroller pins into inputs (unused) and focus on FPGA in Verilog only and here is what I did...

 

 

Story of the build process

These are some useful guides to set up the Arduino IDE and Quartus Prime IDE

  1. https://www.arduino.cc/en/Tutorial/VidorGSVHDL
  2. https://www.arduino.cc/en/Tutorial/VidorQuartusVHDL/
  3. https://maker.pro/arduino/tutorial/how-to-program-the-arduino-mkr-vidor-4000s-fpga-with-intel-quartus-ide

 

Read up on the specifications of the MKR Vidor 4000

  1. https://www.element14.com/community/docs/DOC-92333/l/arduino-mkr-vidor-4000-pinout-samd21-pin-mapping-tech-specs-eagle-files-github-schematics-reference-links-faq-and-more
  2. https://www.baldengineer.com/arduino-mkr-vidor-4000-hands-on.html
  3. https://www.arduino.cc/en/Guide/MKRVidor4000

 

Firstly, I made this Arduino sketch to set all the pins to inputs. As I will be using the FPGA only, I do not need the microcontroller pins and by making it an input, it will prevent shorting the FPGA output to the microcontroller output. I also added Serial pins as later I will be using it for testing.

 

I am using this modified template with the Intel Quartus software. I am using the Verilog language to configure the FPGA.

https://github.com/wd5gnr/VidorFPGA

 

First I tried a flashing LED on pin A6. The clock is 48MHz from the SAMD microcontroller. In this case I made a counter and it used the 22nd bit.

 

Next I made a PWM fading LED on pin A5.

 

As you can see, both codes run simultaneously and my main struggle when I first started was understanding that the FPGA code is similar to building actual hardware.
ie. Important to think in terms of sequential circuits, state diagrams and combinational logic

 

Adding on, here's a buzzer setup where I used frequencies to play tones. This is a simple "Do, Re, Mi" test.

  

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

 

This website shows a list of frequencies for a music note used.

  • https://pages.mtu.edu/~suits/notefreqs.html
  • https://github.com/bhagman/Tone/blob/master/Tone.h

Code is getting pretty long so I wrote it into a separate Verilog file for the 16x2 Character LCD display.

It was challenging too to make the sequential logic and scrolling text across the screen.

 

 

Lastly I added a UART module so that I can send commands from my PC

 

After playing around with the devices separately. Finally, I merged the code together to make the musical jukebox.

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

 

I have published my project code on Github too!
https://github.com/zst123/Vidor-Music-Jukebox

 

Conclusion

 

Thanks again to element14 for sending me an Arduino MKR Vidor 4000 for this project! Was great fun learning about FPGAs and I hope you enjoyed my blog post!

Anonymous

Top Comments

  • 14rhb
    14rhb over 1 year ago +3

    I think you've aced this project i.e. it is very good, bringing together several blocks into the FPGA. Well done.

  • zst123
    zst123 over 1 year ago in reply to 14rhb +3

    Thank you for your kind words! This board is pretty powerful and it was fun indeed. I just ordered a micro HDMI adapter, hopefully I can try out the display capabilities in my next project!

  • dubbie
    dubbie over 1 year ago +2

    Manzel,

     

    A great project. It has been  a long time since I have seen such HDL programmes. I came over all misty eyed. I'm not sure I would want to go back to writing VHDL but I did have fun when I was doing…

  • dubbie
    dubbie over 1 year ago

    Manzel,

     

    A great project. It has been  a long time since I have seen such HDL programmes. I came over all misty eyed. I'm not sure I would want to go back to writing VHDL but I did have fun when I was doing it.

     

    Dubbie

    • Cancel
    • Up +2 Down
    • Reply
    • More
    • Cancel
  • zst123
    zst123 over 1 year ago in reply to 14rhb

    Thank you for your kind words! This board is pretty powerful and it was fun indeed. I just ordered a micro HDMI adapter, hopefully I can try out the display capabilities in my next project!

    • Cancel
    • Up +3 Down
    • Reply
    • More
    • Cancel
  • 14rhb
    14rhb over 1 year ago

    I think you've aced this project i.e. it is very good, bringing together several blocks into the FPGA. Well done.

    • Cancel
    • Up +3 Down
    • Reply
    • More
    • Cancel
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube