40 - PWM Design in Verilog

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ส.ค. 2024

ความคิดเห็น • 20

  • @donny8451
    @donny8451 หลายเดือนก่อน

    Will changing the Switching Frequency, i.e Timer Value affect how long the counter will count for. I am having trouble where the counter will count to 255, but still be at 188 and switch duty cycles which causes a high. So it does not finish counting to 255 and resetting.

  • @user-sj9ui6ve2l
    @user-sj9ui6ve2l ปีที่แล้ว

    Should the timerbit in your code should be equal to TIMER_bit=16 ? because the resolution R is 8bit. The way you have it I am afraid might not be strict 50%duty cycle? Correct me if i am wron

  • @bradleykingston551
    @bradleykingston551 7 หลายเดือนก่อน

    very nice informative and helpful video thanks very much. Please my question is in regard to the number of counts and bits choice. Can i just decide to count to any number let say 0 to 99 in my project or is there an idea behind the number of counts to be chosen for a specific application and how is that related to the frequency?

    • @electronicwoe
      @electronicwoe 2 หลายเดือนก่อน

      The number of counts is indeed application specific. Like he said in video 38 "PWM Main Characteristics", the count determines the resolution, i.e., how much you can subdivide the clock frequency that is controlling the PWM module. For instance, if the clock is 1KHz (period of 1ms), then a count of 10 lets you control the duty cycle in increments of 100μs. A duty of 1 means PWM output is on for 100μs and off for 900μs. A duty cycle of 6 means PWM is on for 600μs and off for 400μs. If your application needs for fine-grained control over the duty cycle, you could choose a count of 100, in which case you can control the duty cycle in increments of 10μs.
      As for the what the frequency of the PWM signal should be, that is dependent on what exactly the PWM signal is driving. This is an involved topic. For instance, driving an LED vs driving a brushless motor vs driving a stepper motor. The frequency you need depends on the physical properties of the device you are controlling.

  • @saisathwik6598
    @saisathwik6598 ปีที่แล้ว

    In trinary operator (x>5 && x

  • @i3ellagio51
    @i3ellagio51 ปีที่แล้ว +2

    Hey, nice video and explanation!! Can you show us the hidden code from the timer module at 27:01 under the picture ?:D I see an assign and always block but the code is hidden :D
    Thank you!

    • @princegupta7003
      @princegupta7003 ปีที่แล้ว

      did you get the code

    • @i3ellagio51
      @i3ellagio51 ปีที่แล้ว

      ​@@princegupta7003 no

    • @princegupta7003
      @princegupta7003 ปีที่แล้ว +1

      @@i3ellagio51 the code is not working
      here is the code
      // timer parameter
      module timer_input
      #(parameter BITS = 4)(
      input clk,
      input reset_n,
      input enable,
      input [BITS - 1:0] FINAL_VALUE,
      // output [BITS - 1:0] Q,
      output done
      );

      reg [BITS - 1:0] Q_reg, Q_next;

      always @(posedge clk, negedge reset_n)
      begin
      if (~reset_n)
      Q_reg

  • @unipia
    @unipia 2 ปีที่แล้ว

    Hello, I think the equation in the vid, (duty - 1) / 2^R = 0.5, is not quite right. When you solve it for 'duty', you would get 129 for duty, which should be 128.

    • @garywilliams4214
      @garywilliams4214 ปีที่แล้ว +1

      The duty cycle is exactly 50%. During the count from 0 to 127 (128 cycles), the PWM signal is high. During the count from 128 to 255 (also 128 cycles), the PWM signal is low. Since the on time and off time are exactly equal, the duty cycle is 50%. Counting from zero can be confusing…what I do mentally is add one to the start and end counts: 0 to 127 is the same as counting from 1 to 128 (0+1 to 127+1). Since I jnow a count of 1-128 is 128 steps, I know 0-127 is also a count of 128. Same approach for 128 to 255: subtract 127 from both start and end and you find it’s equivalent to 1 to 128, again a count of 128.

  • @tanishksingh8443
    @tanishksingh8443 2 ปีที่แล้ว

    Timer Final value is negative if we scale from 50mhz to 1 mhz

  • @omarmurajia1642
    @omarmurajia1642 3 ปีที่แล้ว +1

    How i can contact with you?

  • @slayvirgins2048
    @slayvirgins2048 ปีที่แล้ว

    hello!
    can you create a digital pwm without coding?

  • @omarmurajia1642
    @omarmurajia1642 3 ปีที่แล้ว +1

    Please answer me because I want help about PWM

    • @anassalaheddin1258
      @anassalaheddin1258  3 ปีที่แล้ว +1

      What type of help?

    • @omarmurajia1642
      @omarmurajia1642 3 ปีที่แล้ว

      @@anassalaheddin1258 i have assignment about PWM

    • @anassalaheddin1258
      @anassalaheddin1258  3 ปีที่แล้ว +1

      how can I be of help?

    • @omarmurajia1642
      @omarmurajia1642 3 ปีที่แล้ว

      I want answer this question : Design, synthesize, verify and explain behavioural functionality of a PWM generator. Using code verlog

    • @anassalaheddin1258
      @anassalaheddin1258  3 ปีที่แล้ว +1

      @@omarmurajia1642 well then, you have my videos, and here is a link to the videos github.com/aseddin/ece_3300/tree/main/7%20Counters%20Applications