Commit 25b522e9 authored by Mario Vigliar's avatar Mario Vigliar

Three RGB led on

parent 491ef45e
......@@ -4,7 +4,7 @@
# Version: 2017.08.27940
# File Generated: Feb 8 2018 13:28:21
# File Generated: Feb 12 2018 16:52:46
# Family & Device: iCE40UP5K
......@@ -12,7 +12,6 @@
# ##############################################################################
###IOSet List 2
set_io clk 44
set_io led_o 2
###IOSet List 1
set_io clk 44 -io_std SB_LVCMOS -pullup no
......@@ -6,7 +6,7 @@
-d iCE40UP5K
-t SG48
#constraint file
-sdc "aux/bringup.sdc"
-sdc "constraints/bringup.sdc"
#options
-optimization_goal Area
......
......@@ -25,7 +25,7 @@ DesignCell=bringup
SynthesisSDCFile=iCEVision_bringup_Implmnt/iCEVision_bringup.scf
UserPinConstraintFile=
UserSDCFile=
PhysicalConstraintFile=constraints/bringup_ivr1.pcf
PhysicalConstraintFile=iCEVision_bringup_Implmnt/sbt/constraint/bringup_pcf_sbt.pcf
BackendImplPathName=
Devicevoltage=1.14
DevicevoltagePerformance=+/-5%(datasheet default)
......
......@@ -3,7 +3,7 @@
#project files
add_file -verilog -lib work "rtl/bringup.v"
add_file -constraint -lib work "aux/bringup.sdc"
add_file -constraint -lib work "constraints/bringup.sdc"
#implementation: "iCEVision_bringup_Implmnt"
impl -add iCEVision_bringup_Implmnt -type fpga
......
......@@ -12,18 +12,20 @@
module bringup (/*AUTOARG*/
// Outputs
led_o,
led_o, pmod10,
// Inputs
clk
) ;
input clk;
output led_o;
output [2:0] led_o;
output pmod10;
reg [31:0] led_cnt_r;
wire reset_n;
reg [31:0] led_cnt_r;
wire reset_n;
localparam RESET_TICKS = 32'd1000000;
reg [31:0] reset_cnt = 32'd0;
reg [31:0] reset_cnt = 32'd0;
// Internal reset process
assign reset_n = (reset_cnt == RESET_TICKS);
......@@ -33,7 +35,7 @@ module bringup (/*AUTOARG*/
end
// LED output process
assign led_o = led_cnt_r[25];
always @ (posedge clk) begin
if (!reset_n) begin
/*AUTORESET*/
......@@ -44,6 +46,23 @@ module bringup (/*AUTOARG*/
led_cnt_r <= led_cnt_r + 1;
end
end
assign pmod10 = led_cnt_r[23];
// Open-drain output
SB_RGBA_DRV RGBA_DRIVER (
.CURREN (1'b1),
.RGBLEDEN (1'b1),
.RGB0PWM (led_cnt_r[25]),
.RGB1PWM (led_cnt_r[24]),
.RGB2PWM (led_cnt_r[23]),
.RGB0 (led_o[2]),
.RGB1 (led_o[1]),
.RGB2 (led_o[0]));
defparam RGBA_DRIVER.CURRENT_MODE = "0b0"; // Half current
defparam RGBA_DRIVER.RGB0_CURRENT = "0b111111"; // 4mA
defparam RGBA_DRIVER.RGB1_CURRENT = "0b111111"; // 4mA
defparam RGBA_DRIVER.RGB2_CURRENT = "0b111111"; // 4mA
endmodule // bringup
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment