zhaohe 1 year ago
parent
commit
0f2a5de5df
  1. 3
      .vscode/settings.json
  2. 2
      README.md
  3. BIN
      light_src_ctrl_fpga_port.jic
  4. 11
      light_src_ctrl_fpga_port.map
  5. 2
      run_led.cdf
  6. 2
      run_led.jdi
  7. 48
      run_led.pin
  8. BIN
      run_led.pof
  9. 22
      run_led.qsf
  10. BIN
      run_led.sof
  11. 45
      source/led0_module.v
  12. 45
      source/led1_module.v
  13. 45
      source/led2_module.v
  14. 45
      source/led3_module.v
  15. 67
      source/top_module.v
  16. 60
      source/top_module.v.bak
  17. 70
      source/top_module_bak2.v

3
.vscode/settings.json

@ -0,0 +1,3 @@
{
"files.encoding": "gbk"
}

2
README.md

@ -0,0 +1,2 @@
引脚分配参考:
https://iflytop1.feishu.cn/docx/SqzLdKLmxoAtMLxLEYec2sIcn4g

BIN
light_src_ctrl_fpga_port.jic

11
light_src_ctrl_fpga_port.map

@ -0,0 +1,11 @@
BLOCK START ADDRESS END ADDRESS
Page_0 0x00000000 0x00059D8A
Notes:
- Data checksum for this conversion is 0x1A5DC668
- All the addresses in this file are byte addresses

2
run_led.cdf

@ -4,7 +4,7 @@ JedecChain;
DefaultMfr(6E);
P ActionCode(Cfg)
Device PartName(EP4CE6E22) Path("C:/Users/h_zha/Downloads/Heijin/LTC4CH_FPGA/") File("run_led.sof") MfrSpec(OpMask(1));
Device PartName(EP4CE6E22) Path("D:/workspace/p_light_src_ctrl_20240218/light_src_ctrl_fpga_port/") File("run_led.sof") MfrSpec(OpMask(1));
ChainEnd;

2
run_led.jdi

@ -1,6 +1,6 @@
<sld_project_info>
<project>
<hash md5_digest_80b="a417a43d58438245dc7c"/>
<hash md5_digest_80b="d69ef54cb4531743246c"/>
</project>
<file_info>
<file device="EP4CE6E22C8" path="run_led.sof" usercode="0xFFFFFFFF"/>

48
run_led.pin

@ -95,7 +95,7 @@ GND+ : 24 : : :
GND+ : 25 : : : : 2 :
VCCIO2 : 26 : power : : 3.3V : 2 :
GND : 27 : gnd : : : :
RESERVED_INPUT : 28 : : : : 2 :
trigger_input0 : 28 : input : 3.3-V LVTTL : : 2 : Y
VCCINT : 29 : power : : 1.2V : :
RESERVED_INPUT : 30 : : : : 2 :
RESERVED_INPUT : 31 : : : : 2 :
@ -117,26 +117,26 @@ RESERVED_INPUT : 46 : : :
VCCIO3 : 47 : power : : 3.3V : 3 :
GND : 48 : gnd : : : :
RESERVED_INPUT : 49 : : : : 3 :
RESERVED_INPUT : 50 : : : : 3 :
RESERVED_INPUT : 51 : : : : 3 :
lt_on_off_ctrl_1 : 50 : output : 3.3-V LVTTL : : 3 : Y
lt_on_off_ctrl_2 : 51 : output : 3.3-V LVTTL : : 3 : Y
RESERVED_INPUT : 52 : : : : 3 :
RESERVED_INPUT : 53 : : : : 3 :
RESERVED_INPUT : 54 : : : : 4 :
RESERVED_INPUT : 55 : : : : 4 :
VCCIO4 : 56 : power : : 3.3V : 4 :
GND : 57 : gnd : : : :
RESERVED_INPUT : 58 : : : : 4 :
lt_intensity_1 : 58 : output : 3.3-V LVTTL : : 4 : Y
RESERVED_INPUT : 59 : : : : 4 :
RESERVED_INPUT : 60 : : : : 4 :
lt_intensity_2 : 60 : output : 3.3-V LVTTL : : 4 : Y
VCCINT : 61 : power : : 1.2V : :
VCCIO4 : 62 : power : : 3.3V : 4 :
GND : 63 : gnd : : : :
RESERVED_INPUT : 64 : : : : 4 :
RESERVED_INPUT : 65 : : : : 4 :
lt_intensity_3 : 64 : output : 3.3-V LVTTL : : 4 : Y
lt_on_off_ctrl_3 : 65 : output : 3.3-V LVTTL : : 4 : Y
RESERVED_INPUT : 66 : : : : 4 :
RESERVED_INPUT : 67 : : : : 4 :
RESERVED_INPUT : 68 : : : : 4 :
RESERVED_INPUT : 69 : : : : 4 :
lt_intensity_4 : 68 : output : 3.3-V LVTTL : : 4 : Y
lt_on_off_ctrl_4 : 69 : output : 3.3-V LVTTL : : 4 : Y
RESERVED_INPUT : 70 : : : : 4 :
RESERVED_INPUT : 71 : : : : 4 :
RESERVED_INPUT : 72 : : : : 4 :
@ -170,19 +170,19 @@ RESERVED_INPUT : 99 : : :
RESERVED_INPUT : 100 : : : : 6 :
~ALTERA_nCEO~ / RESERVED_OUTPUT_OPEN_DRAIN : 101 : output : 3.3-V LVTTL : : 6 : N
VCCINT : 102 : power : : 1.2V : :
RESERVED_INPUT : 103 : : : : 6 :
RESERVED_INPUT : 104 : : : : 6 :
RESERVED_INPUT : 105 : : : : 6 :
RESERVED_INPUT : 106 : : : : 6 :
stm32_pc9 : 103 : input : 3.3-V LVTTL : : 6 : Y
stm32_pc8 : 104 : input : 3.3-V LVTTL : : 6 : Y
stm32_pc7 : 105 : input : 3.3-V LVTTL : : 6 : Y
stm32_pc6 : 106 : input : 3.3-V LVTTL : : 6 : Y
VCCA2 : 107 : power : : 2.5V : :
GNDA2 : 108 : gnd : : : :
VCCD_PLL2 : 109 : power : : 1.2V : :
RESERVED_INPUT : 110 : : : : 7 :
camera_shutter_out : 110 : output : 3.3-V LVTTL : : 7 : N
RESERVED_INPUT : 111 : : : : 7 :
RESERVED_INPUT : 112 : : : : 7 :
RESERVED_INPUT : 113 : : : : 7 :
RESERVED_INPUT : 114 : : : : 7 :
RESERVED_INPUT : 115 : : : : 7 :
stm32_pa5 : 114 : input : 3.3-V LVTTL : : 7 : Y
stm32_pa4 : 115 : input : 3.3-V LVTTL : : 7 : Y
VCCINT : 116 : power : : 1.2V : :
VCCIO7 : 117 : power : : 3.3V : 7 :
GND : 118 : gnd : : : :
@ -193,7 +193,7 @@ VCCIO7 : 122 : power : : 3.3V
GND : 123 : gnd : : : :
RESERVED_INPUT : 124 : : : : 7 :
RESERVED_INPUT : 125 : : : : 7 :
RESERVED_INPUT : 126 : : : : 7 :
tp5 : 126 : output : 3.3-V LVTTL : : 7 : N
RESERVED_INPUT : 127 : : : : 7 :
RESERVED_INPUT : 128 : : : : 8 :
RESERVED_INPUT : 129 : : : : 8 :
@ -202,14 +202,14 @@ GND : 131 : gnd : :
RESERVED_INPUT : 132 : : : : 8 :
RESERVED_INPUT : 133 : : : : 8 :
VCCINT : 134 : power : : 1.2V : :
RESERVED_INPUT : 135 : : : : 8 :
RESERVED_INPUT : 136 : : : : 8 :
RESERVED_INPUT : 137 : : : : 8 :
tp6 : 135 : output : 3.3-V LVTTL : : 8 : Y
tp7 : 136 : output : 3.3-V LVTTL : : 8 : Y
tp8 : 137 : output : 3.3-V LVTTL : : 8 : Y
RESERVED_INPUT : 138 : : : : 8 :
VCCIO8 : 139 : power : : 3.3V : 8 :
GND : 140 : gnd : : : :
RESERVED_INPUT : 141 : : : : 8 :
RESERVED_INPUT : 142 : : : : 8 :
RESERVED_INPUT : 143 : : : : 8 :
RESERVED_INPUT : 144 : : : : 8 :
stm32_pa3 : 141 : input : 3.3-V LVTTL : : 8 : Y
stm32_pa2 : 142 : input : 3.3-V LVTTL : : 8 : Y
stm32_pa1 : 143 : input : 3.3-V LVTTL : : 8 : Y
stm32_pa0 : 144 : output : 3.3-V LVTTL : : 8 : Y
GND : EPAD : : : : :

BIN
run_led.pof

22
run_led.qsf

@ -68,4 +68,26 @@ set_location_assignment PIN_10 -to debug_light[1]
set_location_assignment PIN_33 -to debug_light[0]
set_location_assignment PIN_23 -to clk
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8
set_location_assignment PIN_58 -to lt_intensity_1
set_location_assignment PIN_60 -to lt_intensity_2
set_location_assignment PIN_64 -to lt_intensity_3
set_location_assignment PIN_68 -to lt_intensity_4
set_location_assignment PIN_50 -to lt_on_off_ctrl_1
set_location_assignment PIN_51 -to lt_on_off_ctrl_2
set_location_assignment PIN_65 -to lt_on_off_ctrl_3
set_location_assignment PIN_69 -to lt_on_off_ctrl_4
set_location_assignment PIN_144 -to stm32_pa0
set_location_assignment PIN_143 -to stm32_pa1
set_location_assignment PIN_142 -to stm32_pa2
set_location_assignment PIN_141 -to stm32_pa3
set_location_assignment PIN_115 -to stm32_pa4
set_location_assignment PIN_114 -to stm32_pa5
set_location_assignment PIN_106 -to stm32_pc6
set_location_assignment PIN_105 -to stm32_pc7
set_location_assignment PIN_104 -to stm32_pc8
set_location_assignment PIN_103 -to stm32_pc9
set_location_assignment PIN_28 -to trigger_input0
set_location_assignment PIN_135 -to tp6
set_location_assignment PIN_136 -to tp7
set_location_assignment PIN_137 -to tp8
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

BIN
run_led.sof

45
source/led0_module.v

@ -1,45 +0,0 @@
module led0_module
(
CLK, RSTn, LED_Out
);
input CLK;
input RSTn;
output LED_Out;
/*************************************/
parameter T100MS = 23'd5_000_000;//DB4CE15开发板使用的晶振为50MHz50M*0.01=5_000_000
/*************************************/
reg [22:0]Count1;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
Count1 <= 23'd0;
else if( Count1 == T100MS )
Count1 <= 23'd0;
else
Count1 <= Count1 + 1'b1;
/*************************************/
reg rLED_Out;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
rLED_Out <= 1'b0;
else if( Count1 >= 23'd0 && Count1 < 23'd1_250_000 )//100ms的第一个四分之一具体请看教程11页的图2.1C
rLED_Out <= 1'b1;
else
rLED_Out <= 1'b0;
/***************************************/
assign LED_Out = rLED_Out;
/***************************************/
endmodule

45
source/led1_module.v

@ -1,45 +0,0 @@
module led1_module
(
CLK, RSTn, LED_Out
);
input CLK;
input RSTn;
output LED_Out;
/*************************************/
parameter T100MS = 23'd5_000_000;//DB4CE15开发板使用的晶振为50MHz50M*0.01=5_000_000
/*************************************/
reg [22:0]Count1;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
Count1 <= 23'd0;
else if( Count1 == T100MS )
Count1 <= 23'd0;
else
Count1 <= Count1 + 1'b1;
/*************************************/
reg rLED_Out;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
rLED_Out <= 1'b0;
else if( Count1 >= 23'd1_250_000 && Count1 < 23'd2_500_000 )//100ms的第二个四分之一具体请看教程11页的图2.1C
rLED_Out <= 1'b1;
else
rLED_Out <= 1'b0;
/***************************************/
assign LED_Out = rLED_Out;
/***************************************/
endmodule

45
source/led2_module.v

@ -1,45 +0,0 @@
module led2_module
(
CLK, RSTn, LED_Out
);
input CLK;
input RSTn;
output LED_Out;
/*************************************/
parameter T100MS = 23'd5_000_000;//DB4CE15开发板使用的晶振为50MHz50M*0.01=5_000_000
/*************************************/
reg [22:0]Count1;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
Count1 <= 23'd0;
else if( Count1 == T100MS )
Count1 <= 23'd0;
else
Count1 <= Count1 + 1'b1;
/*************************************/
reg rLED_Out;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
rLED_Out <= 1'b0;
else if( Count1 >= 23'd2_500_000 && Count1 < 23'd3_750_000 )//100ms的第三个四分之一具体请看教程11页的图2.1C
rLED_Out <= 1'b1;
else
rLED_Out <= 1'b0;
/***************************************/
assign LED_Out = rLED_Out;
/***************************************/
endmodule

45
source/led3_module.v

@ -1,45 +0,0 @@
module led3_module
(
CLK, RSTn, LED_Out
);
input CLK;
input RSTn;
output LED_Out;
/*************************************/
parameter T100MS = 23'd5_000_000;//DB4CE15开发板使用的晶振为50MHz50M*0.01=5_000_000
/*************************************/
reg [22:0]Count1;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
Count1 <= 23'd0;
else if( Count1 == T100MS )
Count1 <= 23'd0;
else
Count1 <= Count1 + 1'b1;
/*************************************/
reg rLED_Out;
always @ ( posedge CLK or negedge RSTn )
if( !RSTn )
rLED_Out <= 1'b0;
else if( Count1 >= 23'd3_750_000 && Count1 < 23'd5_000_000 )//100ms的第四个四分之一具体请看教程11页的图2.1C
rLED_Out <= 1'b1;
else
rLED_Out <= 1'b0;
/***************************************/
assign LED_Out = rLED_Out;
/***************************************/
endmodule

67
source/top_module.v

@ -1,16 +1,69 @@
module top_module (
clk,
input clk,
//input_from_stm32
input stm32_pc6, // 灯光强度控制PWM
input stm32_pc7, // 灯光强度控制PWM
input stm32_pc8, // 灯光强度控制PWM
input stm32_pc9, // 灯光强度控制PWM
input stm32_pa1, // 快门控制
input stm32_pa2, // 快门控制
input stm32_pa3, // 快门控制
input stm32_pa4, // 快门控制
input stm32_pa5, // 快门控制
//output_to_stm32
output stm32_pa0, // 输入捕获
//光强控制引脚
output lt_intensity_1, //灯光强度控制输出
output lt_intensity_2, //灯光强度控制输出
output lt_intensity_3, //灯光强度控制输出
output lt_intensity_4, //灯光强度控制输出
//拍照控制引脚
output lt_on_off_ctrl_1, //指示灯通断控制输出
output lt_on_off_ctrl_2, //指示灯通断控制输出
output lt_on_off_ctrl_3, //指示灯通断控制输出
output lt_on_off_ctrl_4, //指示灯通断控制输出
output camera_shutter_out, //相机快门控制输出
debug_light
// 触发输入引脚
input trigger_input0, //触发输入
//测试引脚
// output spi2_miso, //用于测试的SPI输出
output tp5,
output tp6,
output tp7,
output tp8,
output [2:0] debug_light
);
input clk;
assign lt_intensity_1 = stm32_pc6;
assign lt_intensity_2 = stm32_pc7;
assign lt_intensity_3 = stm32_pc8;
assign lt_intensity_4 = stm32_pc9;
assign lt_on_off_ctrl_1 = stm32_pa1;
assign lt_on_off_ctrl_2 = stm32_pa2;
assign lt_on_off_ctrl_3 = stm32_pa3;
assign lt_on_off_ctrl_4 = stm32_pa4;
assign camera_shutter_out = stm32_pa5;
output [2:0] debug_light;
assign stm32_pa0 = !trigger_input0;
assign debug_light[0] = 0;
assign debug_light[1] = 1;
assign debug_light[0] = 1;
assign debug_light[1] = 0;
assign debug_light[2] = 0;
assign tp8 = !trigger_input0;
endmodule

60
source/top_module.v.bak

@ -1,60 +0,0 @@
module top_module
(
CLK, RSTn, LED_Out
);
input CLK;
input RSTn;
output [3:0]LED_Out;
/*******************************/
wire LED0_Out;
led0_module U1
(
.CLK( CLK ),
.RSTn( RSTn ),
.LED_Out( LED0_Out )
);
/*********************************/
wire LED1_Out;
led1_module U2
(
.CLK( CLK ),
.RSTn( RSTn ),
.LED_Out( LED1_Out )
);
/*********************************/
wire LED2_Out;
led2_module U3
(
.CLK( CLK ),
.RSTn( RSTn ),
.LED_Out( LED2_Out )
);
/*********************************/
wire LED3_Out;
led3_module U4
(
.CLK( CLK ),
.RSTn( RSTn ),
.LED_Out( LED3_Out )
);
/**********************************/
assign LED_Out = { LED3_Out, LED2_Out, LED1_Out, LED0_Out};
/***********************************/
endmodule

70
source/top_module_bak2.v

@ -1,70 +0,0 @@
module top_module
(
//CLK,
//RSTn,
PC6,
PC7,
PC8,
PA9,
LT_PWM1,
LT_PWM2,
LT_PWM3,
LT_PWM4,
EXIN1,
EXIN1_to_MCU,
PA1,
PA2,
PA3,
PA4,
LT_EN1,
LT_EN2,
LT_EN3,
LT_EN4,
cam_triger
);
//input CLK;
//input RSTn;
input PC6;
input PC7;
input PC8;
input PA9;
output LT_PWM1;
output LT_PWM2;
output LT_PWM3;
output LT_PWM4;
input EXIN1;
output EXIN1_to_MCU;
input PA1;
input PA2;
input PA3;
input PA4;
output LT_EN1;
output LT_EN2;
output LT_EN3;
output LT_EN4;
output cam_triger;
/********光源亮度控制***************/
assign LT_PWM1 = PC6;
assign LT_PWM2 = PC7;
assign LT_PWM3 = PC8;
assign LT_PWM4 = PA9;
/**********************************/
/********光源使能*******************/
assign LT_EN1 = PA1;
assign LT_EN2 = PA2;
assign LT_EN3 = PA3;
assign LT_EN4 = PA4;
/**********************************/
assign EXIN1_to_MCU = EXIN1;
/***********************************/
assign cam_triger = PA1 || PA2 || PA3 || PA4;
endmodule
Loading…
Cancel
Save