From b9eb443e549ab8c81e0c6bc94538f9f2fe2821d4 Mon Sep 17 00:00:00 2001 From: mtnrbq Date: Thu, 4 Feb 2021 07:31:14 +1100 Subject: Add demo with RGB LED --- machxo2/examples/rgbcount.v | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 machxo2/examples/rgbcount.v (limited to 'machxo2/examples/rgbcount.v') diff --git a/machxo2/examples/rgbcount.v b/machxo2/examples/rgbcount.v new file mode 100644 index 00000000..230fc73c --- /dev/null +++ b/machxo2/examples/rgbcount.v @@ -0,0 +1,33 @@ +// Modified from: +// https://github.com/tinyfpga/TinyFPGA-A-Series/tree/master/template_a2 +// https://tinyfpga.com/a-series-guide.html used as a basis. + +module TinyFPGA_A2 ( + (* LOC="21" *) + inout pin6, + (* LOC="26" *) + inout pin9_jtgnb, + (* LOC="27" *) + inout pin10_sda, +); + wire clk; + + OSCH #( + .NOM_FREQ("2.08") + ) internal_oscillator_inst ( + .STDBY(1'b0), + .OSC(clk) + ); + + reg [23:0] led_timer; + + always @(posedge clk) begin + led_timer <= led_timer + 1; + end + + // left side of board + assign pin9_jtgnb = led_timer[23]; + assign pin10_sda = led_timer[22]; + assign pin6 = led_timer[21]; + +endmodule \ No newline at end of file -- cgit v1.2.3