Git Product home page Git Product logo

pwm_openmpw's Introduction

This project contains 4 PWM modules that can be set through the Wishbone bus. Each of them can be configured independently. The four outputs can be observed through both GPIO and Logic Analyzer. The project can be used to control the driver of the hobby cars. The layout of the project can be seen below.

alt text

There are three different operating modes: standard mode, blink mode, and heartbeat mode. In the standard mode, the output signal gives a periodic PWM signal with the same period and duty cycle. In the blink mode, the output toggles between two different PWM signals with a fixed period and duty cycle. In the heartbeat mode, there are again two different PWM signals. But there is a gradual transition between them. The signals can be seen below from the Icarus Verilog.

alt text

There are 16 registers for each PWM module. The register map can be found in verilog/dv/register_map.h in the GitHub repo. The registers are as follows:

state_select:                  The operating mode of the PWM is chosen.
inversion:                     The output is inverted or not.
threshold_counter_standard:    Counter value that determines "1" time of the PWM signal for the standard mode.
period_counter_standard:       Counter value that determines the total period of the PWM signal for the standard mode.
step_standard:                 The counter increases by step times at a cycle.
threshold_counter_blink_1:     Counter value that determines "1" time of the first PWM signal for the blink mode.
threshold_counter_blink_2:     Counter value that determines "1" time of the second PWM signal for the blink mode.
period_counter_blink_1:        Counter value that determines the total period of the first PWM signal for the blink mode.
period_counter_blink_2:        Counter value that determines the total period of the second PWM signal for the blink mode.
step_blink:                    The counter increases by step times at a cycle.
switch_counter_blink:          How fast the toggle between two PWM signals occurs are configured with this value.
threshold_counter_heartbeat_1: Counter value that determines "1" time of the first PWM signal for the heartbeat mode.
threshold_counter_heartbeat_2: Counter value that determines "1" time of the first PWM signal for the heartbeat mode.
period_counter_heartbeat:      Counter value that determines the total period of the PWM signal for the heartbeat mode.
step_heartbeat:                The counter increases by step times at a cycle.
increment_step_heartbeat:      How fast the gradual change between two PWM signals occurs are configured with this value.

The diagram of a PWM module can be seen below.

alt text

The project was simulated at the RTL stage with the Caravel. It is DRC & LVS clean. There are no setup, hold, slew, max capacitance, max fanout violations at the typical case. The hardened macro has an area of 2.3 um x 1 um. The area was increased substantially to allow routability.

pwm_openmpw's People

Contributors

manarabdelaty avatar jeffdi avatar marwaneltoukhy avatar a-omla avatar mkkassem avatar kareefardi avatar ax3ghazy avatar russellfriesenhahn avatar serdarunal132 avatar rtimothyedwards avatar agorararmard avatar mattvenn avatar donn avatar shalan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.