I'm no expert Sim,
but you are writing VHDL like it is a procedural language.
You should really only have the one clock, say the pixel clock which I
assume is pclk,
then make the pixel count, line count and frame count syncronous with
the pixel clock.
John.
:: aH[sIM] :: wrote:
> 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
>
> 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:
>
> Error (10519): VHDL Type or Variable Declaration error at
> camera.vhd(44): bounds of type or variable range must have same type
> Quote:
>
>
> Error (10515): VHDL type mismatch error at camera.vhd(44): integer type does not
match string literal
>
>
> Here my code:
> Quote:
> 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;
>
--
http://www.johnkent.com.au
http://members.optushome.com.au/jekent
------------------------------------
To post a message, send it to: f...@yahoogroups.com
To unsubscribe, send a blank message to: f...@yahoogroups.com

(You need to be a member of fpga-cpu -- send a blank email to fpga-cpu-subscribe@yahoogroups.com )