8 changed files with 109 additions and 237 deletions
-
68camera_light_src_timing_controller_fpga.pds
-
55release/test01/README.md
-
BINrelease/test01/Top.sbit
-
BINrelease/v2.0/xsync_fpage_v2.sbit
-
BINrelease/v2.0/xsync_fpage_v2.sfc
-
83source/src/output/camera_sync_signal_output.v
-
114source/src/output/timecode_output.v
-
26source/src/top.v
@ -0,0 +1,55 @@ |
|||
|
|||
``` |
|||
assign diff_out1 = diff_in1; |
|||
assign diff_out2 = diff_in2; |
|||
assign diff_out3 = diff_in3; |
|||
assign diff_out4 = diff_in4; |
|||
|
|||
|
|||
assign optocoupler_out1 = optocoupler_in1; |
|||
assign optocoupler_out2 = optocoupler_in2; |
|||
assign optocoupler_out3 = optocoupler_in3; |
|||
assign optocoupler_out4 = optocoupler_in4; |
|||
|
|||
|
|||
assign uart_tx = uart_rx; |
|||
assign stm32_output_bus[0] = stm32_input_bus[0]; |
|||
assign stm32_output_bus[1] = stm32_input_bus[1]; |
|||
assign stm32_output_bus[2] = stm32_input_bus[2]; |
|||
assign stm32_output_bus[3] = stm32_input_bus[3]; |
|||
assign stm32_output_bus[4] = stm32_input_bus[4]; |
|||
assign stm32_output_bus[5] = stm32_input_bus[5]; |
|||
assign stm32_output_bus[6] = stm32_input_bus[6]; |
|||
assign stm32_output_bus[7] = stm32_input_bus[7]; |
|||
|
|||
FPGA引出的测试引脚分别输出 |
|||
pwm100hz |
|||
pwm101hz |
|||
pwm102hz |
|||
pwm103hz |
|||
pwm104hz |
|||
pwm105hz |
|||
pwm106hz |
|||
pwm107hz |
|||
pwm108hz |
|||
pwm109hz |
|||
pwm110hz |
|||
pwm111hz |
|||
pwm112hz |
|||
pwm113hz |
|||
pwm114hz |
|||
pwm115hz |
|||
|
|||
亮度控制: |
|||
.pwm100hz(lt1_en), |
|||
.pwm101hz(lt2_en), |
|||
.pwm102hz(lt3_en), |
|||
.pwm103hz(lt4_en), |
|||
.pwm104hz(lt1_intensity_ctrl), |
|||
.pwm105hz(lt2_intensity_ctrl), |
|||
.pwm106hz(lt3_intensity_ctrl), |
|||
.pwm107hz(lt4_intensity_ctrl) |
|||
|
|||
|
|||
|
|||
``` |
@ -1,83 +0,0 @@ |
|||
module camera_sync_signal_output #( |
|||
parameter REG_START_ADD = 0, |
|||
parameter SYS_CLOCK_FREQ = 10000000 |
|||
) ( |
|||
input clk, //clock input |
|||
input rst_n, //asynchronous reset input, low active |
|||
|
|||
//寄存器读写接口 |
|||
input [31:0] addr, |
|||
input [31:0] wr_data, |
|||
input wr_en, |
|||
output wire [31:0] rd_data, |
|||
|
|||
input frame_sig, |
|||
input record_en_sig, |
|||
|
|||
output stm32if_camera_sync_out, //ttl输出信号 |
|||
output stm32if_record_sync_out // |
|||
); |
|||
|
|||
/******************************************************************************* |
|||
* 寄存器列表 * |
|||
*******************************************************************************/ |
|||
reg [31:0] reg1_pulse_mode_valid_len; |
|||
wire [31:0] reg_wr_index; |
|||
|
|||
zutils_register_advanced #( |
|||
.REG_START_ADD(REG_START_ADD) |
|||
) _register ( |
|||
.clk (clk), |
|||
.rst_n (rst_n), |
|||
.addr (addr), |
|||
.wr_data (wr_data), |
|||
.wr_en (wr_en), |
|||
.rd_data (rd_data), |
|||
.reg1 (reg1_pulse_mode_valid_len), |
|||
.reg_wr_sig(reg_wr_sig), |
|||
.reg_index (reg_wr_index) |
|||
); |
|||
|
|||
always @(posedge clk or negedge rst_n) begin |
|||
if (!rst_n) begin |
|||
reg1_pulse_mode_valid_len <= SYS_CLOCK_FREQ / 1000; |
|||
end else begin |
|||
if (reg_wr_sig) begin |
|||
case (reg_wr_index) |
|||
1: reg1_pulse_mode_valid_len <= wr_data; |
|||
default: begin |
|||
end |
|||
endcase |
|||
end |
|||
end |
|||
end |
|||
|
|||
/******************************************************************************* |
|||
* 内部信号 * |
|||
*******************************************************************************/ |
|||
|
|||
wire frame_sig_rising_edge; |
|||
wire frame_sig_fa_process; |
|||
|
|||
// 边沿检测 |
|||
zutils_edge_detecter _signal_in ( |
|||
.clk (clk), |
|||
.rst_n (rst_n), |
|||
.in_signal (frame_sig), |
|||
.in_signal_rising_edge(frame_sig_rising_edge) |
|||
); |
|||
|
|||
// 短脉冲,触发生成,长脉冲 |
|||
zutils_pluse_generator _pluse_generator ( |
|||
.clk (clk), |
|||
.rst_n (rst_n), |
|||
.pluse_width (reg1_pulse_mode_valid_len), //100us |
|||
.pluse_delay (0), |
|||
.trigger (frame_sig_rising_edge), |
|||
.output_signal(frame_sig_fa_process) |
|||
); |
|||
|
|||
assign stm32if_camera_sync_out = frame_sig_fa_process; |
|||
assign stm32if_record_sync_out = record_en_sig; |
|||
|
|||
endmodule |
@ -1,114 +0,0 @@ |
|||
module timecode_output #( |
|||
parameter REG_START_ADD = 0, |
|||
parameter SYS_CLOCK_FREQ = 10000000 |
|||
) ( |
|||
input clk, //clock input |
|||
input rst_n, //asynchronous reset input, low active |
|||
|
|||
input [31:0] addr, |
|||
input [31:0] wr_data, |
|||
input wr_en, |
|||
output wire [31:0] rd_data, |
|||
|
|||
/******************************************************************************* |
|||
* TIMECODE输出 * |
|||
*******************************************************************************/ |
|||
|
|||
input in_timecode_tigger_sig, |
|||
input [31:0] in_timecode_format, |
|||
input [63:0] in_timecode_data, |
|||
input in_timecode_serial_data, |
|||
|
|||
/******************************************************************************* |
|||
* 输出接口 * |
|||
*******************************************************************************/ |
|||
output stm32if_timecode_tigger_sig, |
|||
|
|||
output reg timecode_out_bnc, |
|||
output reg timecode_out_bnc_select, // 电平选择 0line,1:mic |
|||
output reg timecode_out_bnc_state_led, |
|||
|
|||
output reg timecode_out_headphone, |
|||
output reg timecode_out_headphone_select, // 电平选择 0line,1:mic |
|||
output reg timecode_out_headphone_state_led |
|||
|
|||
); |
|||
// 1ms |
|||
wire [31:0] r1_timecode0; //时码原始码0 //注意这个数据要比ext_timecode_serial_data晚一帧 |
|||
wire [31:0] r2_timecode1; //时码原始码1 //注意这个数据要比ext_timecode_serial_data晚一帧 |
|||
wire [31:0] r3_timecode_format; // |
|||
reg [31:0] r4_bnc_outut_level_select; // 0:line, 1:mic |
|||
reg [31:0] r5_headphone_outut_level_select; // 0:line, 1:mic |
|||
|
|||
wire [31:0] reg_wr_index; |
|||
|
|||
zutils_register_advanced #( |
|||
.REG_START_ADD(REG_START_ADD) |
|||
) _register ( |
|||
.clk (clk), |
|||
.rst_n (rst_n), |
|||
.addr (addr), |
|||
.wr_data(wr_data), |
|||
.wr_en (wr_en), |
|||
.rd_data(rd_data), |
|||
|
|||
.reg1(r1_timecode0), |
|||
.reg2(r2_timecode1), |
|||
.reg3(r3_timecode_format), |
|||
.reg4(r4_bnc_outut_level_select), |
|||
.reg5(r5_headphone_outut_level_select), |
|||
|
|||
|
|||
.reg_wr_sig(reg_wr_sig), |
|||
.reg_index (reg_wr_index) |
|||
); |
|||
|
|||
always @(posedge clk or negedge rst_n) begin |
|||
if (!rst_n) begin |
|||
r4_bnc_outut_level_select <= 0; |
|||
r5_headphone_outut_level_select <= 0; |
|||
end else begin |
|||
if (reg_wr_sig) begin |
|||
case (reg_wr_index) |
|||
31'h4: r4_bnc_outut_level_select <= wr_data; |
|||
31'h5: r5_headphone_outut_level_select <= wr_data; |
|||
default: begin |
|||
end |
|||
endcase |
|||
end |
|||
end |
|||
end |
|||
|
|||
|
|||
assign r1_timecode0 = in_timecode_data[31:0]; |
|||
assign r2_timecode1 = in_timecode_data[63:32]; |
|||
assign r3_timecode_format = in_timecode_format; |
|||
assign out_timecode_serial_data = in_timecode_serial_data; |
|||
assign timecode_tigger_sig = in_timecode_tigger_sig; |
|||
|
|||
|
|||
zutils_pluse_generator _pluse_generator ( |
|||
.clk (clk), |
|||
.rst_n (rst_n), |
|||
.pluse_width (1000), //1ms |
|||
.pluse_delay (32'd0), |
|||
.trigger (timecode_tigger_sig), |
|||
.output_signal(stm32if_timecode_tigger_sig) |
|||
); |
|||
|
|||
|
|||
always @(*) begin |
|||
timecode_out_bnc <= out_timecode_serial_data; |
|||
timecode_out_bnc_select <= r4_bnc_outut_level_select[0]; |
|||
timecode_out_bnc_state_led <= 1; |
|||
|
|||
timecode_out_headphone <= out_timecode_serial_data; |
|||
timecode_out_headphone_select <= r5_headphone_outut_level_select[0]; |
|||
timecode_out_headphone_state_led <= 1; |
|||
end |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
endmodule |
Write
Preview
Loading…
Cancel
Save
Reference in new issue