-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinst_ov7670_controller
68 lines (66 loc) · 1.4 KB
/
inst_ov7670_controller
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 06/24/2021 11:35:45 AM
// Design Name:
// Module Name: ov7670_controller
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module ov7670_controller(
input clk,
input resend,
output config_finished,
output sioc,
inout siod,
output reset,
output pwdn,
output xclk
);
wire [15:0]command;
wire finished = 1'b0;
wire taken = 1'b0;
wire send;
localparam camera_address = 7'b1000010;
reg sys_clk;
assign config_finished = finished;
assign send = ~( finished);
i2c_sender inst_i2c_sender (
.clk(clk),
.id(7'b1000010),
.reg1(command[15:8]),
.send(send),
.value(command[7:0]),
.sioc(sioc),
.taken(taken),
.siod(siod)
);
assign reset = 1'b1;
assign pwdn = 1'b0;
assign xclk = sys_clk;
ov7670_registers inst_ov7670_registers (
.advance(taken),
.clk(clk),
.resend(resend),
.command(command),
.finished(finished)
);
always @ ( posedge clk)
begin
if ( clk == 1'b1 )
begin
sys_clk <= ~( sys_clk);
end
end
endmodule