logo-mobile

ROHM

ROHM
Menu
  • Arduino –
  • Raspberry Pi –
  • Trending –
  • Others –
  • About –
  • Contact –

Arduino

Intro to FPGAs with the Mojo – Part 2

Rahul Iyer
Published by Rahul Iyer at July 14, 2017
Categories
  • Arduino
Tags
  • fpga
  • mojo
  • pulse-width modulation
  • pwm
fpga mojo

Table of Contents

  • Intro & Pulse-Width Modulation (PWM)
  • Hardware PWM on the Mojo FPGA
  • Hardware PWM on the Mojo FPGA (Continued) & Appendix

fpga mojo

In Part 1 of this tutorial, we introduced FPGAs and went through a simple starter project on the Mojo FPGA from Embedded Micro.  In part 2, we’ll cover a more complex project: implementing hardware PWM on the Mojo FPGA.  

Pulse-Width Modulation (PWM) is widely used in embedded systems to control the brightness of LEDs, the speed of motors, and even for communication.  If you’ve used the Arduino, you’ve certainly come across PWM when using the analogWrite() function.  Before we can implement PWM on the Mojo, we should first take a look at how PWM works!

Pulse-Width Modulation (PWM)

Microcontrollers and other embedded systems processors compute and perform tasks with digital signals.  These signals only occur in one of two voltage states: a “high” voltage, usually 3.3V or 5V, and a “low” voltage, which is usually 0V.  These two voltages encode binary 1’s and 0’s respectively, and can thus be used to perform an enormous variety of tasks.  

But what if we want to output voltages at finer levels than just on or off?  This is the motivating question in applications such as the ones mentioned above, where some variable output intensity is required.  One solution is to connect the system to an external device called a Digital to Analog Converter (DAC), which takes digital signal inputs in the form of binary 1’s and 0’s from a main processor and outputs voltages in an almost-continuous range from 0V to the system “high” voltage.  However, for most embedded system applications, a simpler method exists: PWM!

In a sense, PWM makes use of the fact that human senses and physical systems such as motors average rapidly changing inputs.  The system generates a digital signal that pulses at a high frequency such that individual pulses are not distinguishable.  In a given period of this waveform, the signal is high for some portion of the time and low for the rest — this portion of time in which the signal is high is called the duty or duty cycle of the signal.  The average output effect, be it the brightness of an LED or the speed of a motor, depends on the duty of the PWM signal.  Of course, as the name suggests, we can change the output effect by changing the duty (the pulse width) of the wave!  The following diagram shows a comparison of different duty cycles and their corresponding waveforms.  

fpga mojo

Figure 1. Comparison of different duty cycles and their associated pulse waveforms.  It is clear that the most “intense” output effect occurs at 100% duty cycle when the signal is constantly high.

Microcontroller ICs such as the ATMega chips found on Arduino boards have internal hardware dedicated to generating PWM signals upon command from the processor.  The outputs of these circuits are connected to specific pins on the microcontroller IC that are dedicated as PWM output lines.  However, this also means that only these pins can provide PWM signals.  On an FPGA like the Mojo, however, we can configure internal hardware as we please, which means that we can create as many hardware PWM circuits as we would like!  

1 2 3
Rahul Iyer
Rahul Iyer
Studying Electrical Engineering at UCLA, Rahul loves to work on electronics and robotics projects as a hobby. He is especially enthusiastic about electric vehicle technology and assistive robotics.

Check us out on Social Media

  • Facebook
  • Twitter

Recommended Posts

  • FPGA Tutorial: Intro to FPGAs with the Mojo – Part 1FPGA Tutorial: Intro to FPGAs with the Mojo – Part 1
  • Servo Motor Controlled Wireless Light SwitchServo Motor Controlled Wireless Light Switch
  • Arduino Robot RF Explorer – Part 2 – Putting Everything TogetherArduino Robot RF Explorer – Part 2 – Putting Everything Together
  • How To Make Your Own RobotHow To Make Your Own Robot
  • Arduino and Booleans: The truth is greater than zero!Arduino and Booleans: The truth is greater than zero!
  • Intro to CMUcam5 Pixy Vision Camera Sensor Part 2 – Creating a Ball Balance BeamIntro to CMUcam5 Pixy Vision Camera Sensor Part 2 – Creating a Ball Balance Beam
Receive update on new postsPrivacy Policy

Recommended Tutorials

  • How to integrate an RFID module with Raspberry Pi How to integrate an RFID module with Raspberry Pi
  • How to Use the NRF24l01+ Module with Arduino How to Use the NRF24l01+ Module with Arduino
  • How to Run Arduino Sketches on Raspberry Pi How to Run Arduino Sketches on Raspberry Pi
  • Setting Up Raspberry Pi as a Home Media Server Setting Up Raspberry Pi as a Home Media Server

Recommended Trends

  • SewBot Is Revolutionizing the Clothing Manufacturing Industry SewBot Is Revolutionizing the Clothing Manufacturing Industry
  • All About The Sumo Robot Competition And Technology All About The Sumo Robot Competition And Technology
  • 5 Interesting Tips to Calculating the Forward Kinematics of a Robot 5 Interesting Tips to Calculating the Forward Kinematics of a Robot
  • Go Inside the Drones That Are Changing Food Delivery Go Inside the Drones That Are Changing Food Delivery
Menu
  • Arduino –
    Arduino Beginner’s Guide
  • Raspberry Pi –
    Raspberry Pi Beginner's Guide
  • Trending –
    Updates on New Technologies
  • Others –
    Interviews / Events / Others

Check us out on Social Media

  • Facebook
  • Twitter
  • About
  • Company
  • Privacy Policy
  • Terms of Service
  • Contact
  • Japanese
  • 简体中文
  • 繁體中文
Don’t Forget to Follow Us!
© Copyright 2016-2022. Device Plus - Powered by ROHM
© 2022 Device Plus. All Rights Reserved. Muffin group

istanbul escort istanbul escort istanbul escort