错误 10344 是由于位范围不匹配造成的,您似乎已经解决了这个问题,您可以编译它并查看新的 RTL。
但是,如果您不使用额外的 4 位,它们将在编译/综合期间被优化。
要将相机数据从 8 位更改为 12 位,您需要更改以下信号的位范围,并根据新相机的技术规范使用所有位:
ov7670_data
d
latched_d
d_latch
dout
还要注意ov7670_pwdn 和ov7670_reset 以及其他可能与新相机不同的相机控制信号。
正如您所发现的,尝试更改现有的相机控制器来控制新相机是很困难的,如果不是不可能的话。
所以最好用D5M controller from the Terasic demo替换现有的控制器。
top.vhd
第 78 行:
ov7670_data : in STD_LOGIC_VECTOR(7 downto 0);
第 522 行:
Inst_ov7670_capture: ov7670_capture PORT MAP(
pclk => ov7670_pclk,
capture => take_snapshot,
vsync => ov7670_vsync,
href => ov7670_href,
d => ov7670_data,
addr => image_wraddress_from_ov7670_capture,
dout => image_wrdata_from_ov7670_capture,
we => image_wren_from_ov7670_capture,
busy => ov7670_capture_busy
);
ov7670_capture.vhd
entity ov7670_capture is
Port ( pclk : in STD_LOGIC;
capture : in STD_LOGIC; -- recieves signal from a button to begin a single frame capture
vsync : in STD_LOGIC;
href : in STD_LOGIC;
d : in STD_LOGIC_VECTOR (7 downto 0);
addr : out STD_LOGIC_VECTOR (16 downto 0);
dout : out STD_LOGIC_VECTOR (11 downto 0);
we : out STD_LOGIC;
busy : out STD_LOGIC
);
end ov7670_capture;
第 33 行:
signal d_latch : std_logic_vector(15 downto 0) := (others => '0');
第 41 行:
signal latched_d : STD_LOGIC_VECTOR (7 downto 0) := (others => '0');
第 48 行:
dout <= d_latch(15 downto 12) & d_latch(10 downto 7) & d_latch(4 downto 1);
第 77 行:
-- capturing the data from the camera, 12-bit RGB
if latched_href = '1' then
d_latch <= d_latch( 7 downto 0) & latched_d;
end if;
第 110 行:
latched_d <= d;
编译原件
Warning (13024): Output pins are stuck at VCC or GND
Warning (13410): Pin "vga_sync_N" is stuck at VCC
Warning (13410): Pin "ov7670_pwdn" is stuck at GND
Warning (13410): Pin "ov7670_reset" is stuck at VCC