element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
FPGA
  • Technologies
  • More
FPGA
Blog Summer of FPGAs - Building an Embedded System on FPGA
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: yesha98
  • Date Created: 16 Aug 2021 4:31 PM Date Created
  • Views 4830 views
  • Likes 10 likes
  • Comments 21 comments
Related
Recommended

Summer of FPGAs - Building an Embedded System on FPGA

yesha98
yesha98
16 Aug 2021

Introduction:

Back then in February when I roadtested the USB104-A7, I had learned to create block designs using MicroBlaze. I found it very interesting but the available online resources were limited, the tutorials were based on the older versions of Vivado (Uploaded 6 years back or so). So I thought of making a course on using MicroBlaze in block designs and programming it with Xilinx SDK. Finally, after my semester exams were over, I got some free time to record the tutorials and the course material.

 

The course is designed in such a way that basic knowledge on FPGA programming using Vivado would be sufficient to take up this course. Also, the learner will understand the design of hardware while making the custom Pmod (Pmod Character LCD) and the working of Rotary Encoder.

 

Also, in this course, the design will be modified as new modules are added according to the requirements. The quadrature decoder module described in Verilog will also be added to the design at a later stage in the course. Thus, the learner will be able to feel the essence of the term "Reconfigurable Hardware".

 

Course Contents:

Video 1 - Introduction to MicroBlaze and AXI

Video 2 -- Lab 1 - Creating a block design with MicroBlaze and AXI GPIOs

Video 3 -- Lab 2 - Writing code in Xilinx SDK to interface with user LED and Pushbutton

Video 4 - Working of Character LCD and making of the Pmod LCD

Video 5 -- Lab 3 - Modifying the block design to interface Pmod LCD

Video 6 -- Lab 4 - LCD Driver Code to display elapsed seconds in LCD

Video 7 - Working of Rotary Encoder and Quadrature Decoder

VIdeo 8 -- Lab 5 - Adding the Quadrature Decoder Module to the Design

Video 9 -- Lab 6 - Writing code in SDK to display count and direction to the LCD

VIdeo 10 - Final Assessment

 

 

About the Course:

All videos are available on YouTube, here's the link to Playlist: https://www.youtube.com/playlist?list=PL6jYIySXv7VhUjg95oP88ubxRrr9MQMfH

Complete the final assessment to earn a certificate!

 

Course Overview:

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

 

Thanks for reading!

  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 3 years ago +2
    Video 3 also worked perfectly on a Pynq-Z2 board with Zynq IC. www.youtube.com/watch
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to yesha98 +2
    yesha98 wrote: ... Btw, I have a doubt, so you added the onboard LEDs and Pushbuttons through AXI GPIO right. After adding the Zynq IP in block design, if we run the block automation, the Fixed IO and…
  • navadeepganeshu
    navadeepganeshu over 3 years ago +2
    Gave a try with ARTY S7 - 50. For this board, I skipped adding NOT logic for reset(lab video1) as it was active low with the onboard switch by default. Used GPIO0 and 1 for 4 x LEDs and 4 x pushbuttons…
  • yesha98
    yesha98 over 3 years ago in reply to navadeepganeshu

    That's great! Yeah, it truly fascinates me when we can actually change the hardware which is not possible in the case of microcontrollers.

     

    The LCD is a bit problematic in the beginning because it's a bit hard to debug where the loose contact is, but eventually, you'll figure it out! image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • navadeepganeshu
    navadeepganeshu over 3 years ago in reply to yesha98

    Works in charm! After this, I made the sw_in pin external and mapped the same to PIN2 of the Pmod by uncommenting and adding sw_in on the .xdc file.

    True. The real beauty is that now the hardware has got configured(quadrature decoder) with additional input switch parameter by what it seems like a software tweak(verilog file). Btw, Vivado is hiding a lot of stuff image


    image

    The LCD is showing up like this. Seems like a familiar loose contact issue in these type of parallel display interfaces. I'll check back the hardware wiring -- had rushed with the soldering process.

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • yesha98
    yesha98 over 3 years ago in reply to navadeepganeshu

    Oh yes. We need to modify the Quadrature Decoder hardware.

     

    module Quad_Decode (clk, rot_en_A, rot_en_B, direction, count, sw_in);

     

    input clk, rot_en_A, rot_en_B, sw_in;

    output reg direction;

    output [7:0] count;

     

    reg [2:0] rot_en_A_delayed, rot_en_B_delayed;

     

    always @(posedge clk)

    begin

    rot_en_A_delayed <= {rot_en_A_delayed[1:0], rot_en_A};

    end

     

    always @(posedge clk)

    begin

    rot_en_B_delayed <= {rot_en_B_delayed[1:0], rot_en_B};

    end

     

    wire count_enable = rot_en_A_delayed[1] ^ rot_en_A_delayed[2] ^ rot_en_B_delayed[1] ^ rot_en_B_delayed[2];

    wire count_direction = rot_en_A_delayed[1] ^ rot_en_B_delayed[2];

     

    reg [7:0] count;

     

    always @(posedge clk)

    begin

      if(count_enable)

      begin

        if(count_direction)

        begin

          direction <= 1;

          count <= count + 1;

        end

        else

        begin

          direction <= 0;

          count <= count - 1;

        end

      end

      else

       begin

         if (!sw_in)

         count <= 0;

      end

    end

     

    endmodule

     

    Connect the switch directly to the Quad_Decode module in block design.

    I guess this should do.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • navadeepganeshu
    navadeepganeshu over 3 years ago

    Again on Arty-S7, the rotary thing works fine the same way.

    I tried to add another parameter "Status" which would detect if the user presses the rotary encoder's central switch so as to set the value back to 0 at any point. So, added a new AXI_GPIO 1 bit wide to read SW pin of rotary encoder and took that parameter into the same while loop with if(status == 0). It was just a lame idea of trying to make it, I realized after running the program.

    The status does flip to 0 and so does the count. But when the switch is released, Status turns back to 1 as expected and counter resumes from the same point where it was before pressing that switch. Rather it was expected to start back from 0. So for this, would tweaking the quad_decode.v and adding in a new parameter to reset the full counter help? Any clues?

     

    image

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • yesha98
    yesha98 over 3 years ago in reply to navadeepganeshu

    That's great navadeepganeshu! I hope you'll enjoy the upcoming modules in the series too!

    • 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