User`s manual

16 assign addr = (vcount[9:1] << 8) + (vcount[9:1] << 6) + (hcount >> 1);
17 endmodule
A.3.8 slow clk.v
1 ///////////////////////////////////////////////////////////////////////////////////////////////////
2 // this module generates a VERY SLOW clk by a simple counter
3 // note: this method is NOT robust to timing issues, and for slowing
4 // down/speeding up a clk by a reasonable multiple (e.g 2, 3), use DCM instead
5 // to guarantee phase locking, elimination of most skew, etc
6 // Here, the intent is only to generate a pulse with a time period of order of
7 // seconds
8 ///////////////////////////////////////////////////////////////////////////////////////////////////
9 module slow_clk(input clk, output slow_clk);
10 parameter TICKS = 27’d49_999_999;
11
12 reg [31:0] count = 0;
13 reg sig_reg = 0;
14
15 always @(posedge clk) begin
16 if (count == TICKS) begin
17 // flip at half period
18 sig_reg <= ~sig_reg;
19 count <= 0;
20 end
21 else begin
22 count <= count + 1;
23 end
24 end
25 assign slow_clk = sig_reg;
26 endmodule
A.3.9 move cursor.v
1 ///////////////////////////////////////////////////////////////////////////////////////////////////
2 // move_cursor: This module implements a simple UI for manually adjusting the
3 // projector correction via pressing the arrow keys, and selecting which
4 // corner of the quadrilateral the user is manipulating via switch[1:0] positions.
5 // 00 -> point 1, 01 -> point 2, 10 -> point 3, 11 -> point 4
6 // All the adjustments can only happen when the override is pressed.
7 // Inputs are xi_raw, yi_raw (obtained from accelerometer lut)
8 // Outputs are xi, yi and display_x, display_y (for hex display).
9 // The intention is to run this on a slow clk, even vsync could be a little
10 // too fast
11 ///////////////////////////////////////////////////////////////////////////////////////////////////
12 module move_cursor(input clk,
223