Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pwm: Default PWM to low on init

When the PWM is unconfigured, it should drive the line low rather than
high.  This patch adds a check to the PWM signal generator to detect if
the period and pulse are both 0 (as they are upon init), and drives the
signal to 0 in that case.
  • Loading branch information...
commit f50597f449198cc39ee417d688612d52c8b15508 1 parent a0a4041
@xobs xobs authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  kovan1.srcs/sources_1/imports/kovan1/common/servo_pwm.v
View
2  kovan1.srcs/sources_1/imports/kovan1/common/servo_pwm.v
@@ -34,7 +34,7 @@ module servo_pwm(
end // always @ (posedge clk or posedge reset)
always @(posedge clk) begin
- if( period_cnt > pulse ) begin
+ if( (!period && !pulse) || (period_cnt > pulse) ) begin
pwm_state <= 1;
end else begin
pwm_state <= 0;
Please sign in to comment.
Something went wrong with that request. Please try again.