-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module blinky_upduino2 | ||
( | ||
output wire g, | ||
output wire b, | ||
output wire r); | ||
|
||
wire clk; | ||
wire q; | ||
reg q_r; | ||
reg [2:0] rgb = 3'b001; | ||
|
||
SB_HFOSC inthosc | ||
( | ||
.CLKHFPU(1'b1), | ||
.CLKHFEN(1'b1), | ||
.CLKHF(clk)); | ||
|
||
SB_RGBA_DRV | ||
#( | ||
.CURRENT_MODE ("0b1"), | ||
.RGB0_CURRENT ("0b000111"), | ||
.RGB1_CURRENT ("0b000111"), | ||
.RGB2_CURRENT ("0b000111")) | ||
RGBA_DRIVER | ||
( | ||
.CURREN(1'b1), | ||
.RGBLEDEN(1'b1), | ||
.RGB0PWM(rgb[0] & q), | ||
.RGB1PWM(rgb[1] & q), | ||
.RGB2PWM(rgb[2] & q), | ||
.RGB0(g), | ||
.RGB1(b), | ||
.RGB2(r)); | ||
|
||
always @(posedge clk) begin | ||
q_r <= q; | ||
if (q & !q_r) | ||
rgb <= {rgb[1:0], rgb[2]}; | ||
end | ||
|
||
blinky #(.clk_freq_hz (48_000_000)) blinky | ||
(.clk (clk), | ||
.q (q)); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set_io g 39 | ||
set_io b 40 | ||
set_io r 41 |