Skip to content

Commit

Permalink
iCE40-UP5K: blink example added
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Apr 7, 2018
1 parent d8217b2 commit 7f7cce4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iCE40-UP5K/blink/apio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[env]
board = iCE40-UP5K

19 changes: 19 additions & 0 deletions iCE40-UP5K/blink/blink.v
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions iCE40-UP5K/blink/up5k.pcf
Original file line number Diff line number Diff line change
@@ -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



0 comments on commit 7f7cce4

Please sign in to comment.