From 7f7cce4195b653f159f16b2d92f01ce6050abd3b Mon Sep 17 00:00:00 2001 From: obijuan Date: Sat, 7 Apr 2018 14:20:00 +0200 Subject: [PATCH] iCE40-UP5K: blink example added --- iCE40-UP5K/blink/apio.ini | 3 +++ iCE40-UP5K/blink/blink.v | 19 +++++++++++++++++++ iCE40-UP5K/blink/up5k.pcf | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 iCE40-UP5K/blink/apio.ini create mode 100644 iCE40-UP5K/blink/blink.v create mode 100644 iCE40-UP5K/blink/up5k.pcf diff --git a/iCE40-UP5K/blink/apio.ini b/iCE40-UP5K/blink/apio.ini new file mode 100644 index 0000000..c27c8af --- /dev/null +++ b/iCE40-UP5K/blink/apio.ini @@ -0,0 +1,3 @@ +[env] +board = iCE40-UP5K + diff --git a/iCE40-UP5K/blink/blink.v b/iCE40-UP5K/blink/blink.v new file mode 100644 index 0000000..8f507b9 --- /dev/null +++ b/iCE40-UP5K/blink/blink.v @@ -0,0 +1,19 @@ + +module rgb_test (input clk, + output led_blue, + output led_green, + output led_red); + + +//-- Modify this value for changing the blink frequency +localparam N = 24; //-- N<=21 Fast, N>=23 Slow + +reg [N:0] counter; +always @(posedge clk) + counter <= counter + 1; + +assign led_green = counter[N]; +assign led_blue = counter[N-1]; +assign led_red = counter[N-2]; + +endmodule diff --git a/iCE40-UP5K/blink/up5k.pcf b/iCE40-UP5K/blink/up5k.pcf new file mode 100644 index 0000000..8e63ec8 --- /dev/null +++ b/iCE40-UP5K/blink/up5k.pcf @@ -0,0 +1,8 @@ + +set_io --warn-no-port led_blue 39 +set_io --warn-no-port led_green 40 +set_io --warn-no-port led_red 41 +set_io --warn-no-port clk 35 + + +