Here's the scenario, typical camera have vsync,href,pclk and 8-bits data.
vsync represents new frame
href represents new line
pclk represents new pixel
http://img85.imageshack.us/img85/3275/outputsignalue4.jpg I would like to capture the first 50x50 pixels of the frame and another frame after the 60th frame.
All I need is two frames.
I'm getting this error
--- Quote Start ---
Error (10519): VHDL Type or Variable Declaration error at camera.vhd(44): bounds of type or variable range must have same type
--- Quote End ---
--- Quote Start ---
Error (10515): VHDL type mismatch error at camera.vhd(44): integer type does not match string literal
--- Quote End ---
Here my code:
--- Quote Start ---
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
ENTITY camera IS
PORT
(
start : IN STD_LOGIC;
pixel : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
clk : IN STD_LOGIC;
vsync : IN STD_LOGIC;
href : IN STD_LOGIC;
pclk : IN STD_LOGIC;
pixel_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
reference : OUT STD_LOGIC
);
END camera;
ARCHITECTURE behave OF camera IS
SIGNAL frame_count : STD_LOGIC_VECTOR(6 DOWNTO 0);
SIGNAL line_count : STD_LOGIC_VECTOR(6 DOWNTO 0);
SIGNAL pixel_count : STD_LOGIC_VECTOR(6 DOWNTO 0);
BEGIN
PROCESS (vsync, href, pclk)
BEGIN
IF start='1' THEN--------------------------------------------STARTS THE CAPTURING SEQUENCE
frame_count <= (OTHERS => '0');
line_count <= (OTHERS => '0');
pixel_count <= (OTHERS => '0');
IF(vsync'EVENT AND vsync = '1' ) THEN
FOR frame_count IN "0000000" TO "111100" LOOP
frame_count <= frame_count + "0000001"; -------------COUNTS FRAME UNTIL 60
IF(href'EVENT AND href = '1' ) THEN
FOR line_count IN "0000000" TO "110010" LOOP
line_count <= line_count + "0000001";---------COUNTS LINE UNTIL 50
IF(pclk'EVENT AND pclk = '1' ) THEN
FOR pixel_count IN "0000000" TO "110010" LOOP
pixel_count <= pixel_count + "0000001"; --COUNTS PIXEL UNTIL 50
pixel_out<=pixel;-----------------------------OUTPUTS THE PIXEL DATA
reference<='1';------------------------------FOR SAVING THE DATA INTO RAM PURPOSES
END LOOP;
END IF;
END LOOP;
END IF;
END LOOP;
END IF;
ELSE
null;
END IF;
END PROCESS;
END behave;
--- Quote End ---