cmqdcyy 发表于 2012-6-22 16:29:26

图像采集求助

下面是我用QuartusII中_SignalTapⅡ逻辑分析仪检测的实验数据,怎么FVAL和LVAL总是没有波形出来呢,高手帮我分析一下下,我实在是不知道哪里的问题了。麻烦大家了

pocker5200 发表于 2012-6-22 16:41:36

至少把仿真的模块功能介绍一下吧……光一张图完全不知所云。

cmqdcyy 发表于 2012-6-22 17:22:01

pocker5200 发表于 2012-6-22 16:41 static/image/common/back.gif
至少把仿真的模块功能介绍一下吧……光一张图完全不知所云。

就是通过OV9650摄像头采集图像然后通过VGA显示,这个是CCD_capture模块中的测试数据,我不知道哪个地方出问题,那两个信号不出。下面是程序
module CCD_Capture(        oDATA1,
                                        oDATA2,
                                        oDVAL,
                                        oX_Cont,
                                        oY_Cont,
                                        oFrame_Cont,
                                        iDATA,
                                        iFVAL,
                                        iLVAL,
                                        iSTART,
                                        iEND,
                                        iCLK,
                                        iRST        );
                                       
input                iDATA;
input                        iFVAL;
input                        iLVAL;
input                        iSTART;
input                        iEND;
input                        iCLK;
input                        iRST;
output                oDATA1;
output                oDATA2;
output                oX_Cont;
output                oY_Cont;
output                oFrame_Cont;
output                        oDVAL;
reg                                Pre_FVAL;
reg                                mCCD_FVAL;
reg                                mCCD_LVAL;
reg                        mCCD_DATA1;
reg                        mCCD_DATA2;
reg                        X_Cont;
reg                        Y_Cont;
reg                        Frame_Cont;
reg                                mSTART;

assign        oX_Cont                =        X_Cont;
assign        oY_Cont                =        Y_Cont;
assign        oFrame_Cont        =        Frame_Cont;
assign        oDATA1                =        mCCD_DATA1;
assign        oDATA2                =        mCCD_DATA2;
assign        oDVAL                =        mCCD_FVAL&mCCD_LVAL;


always@(posedge iCLK or negedge iRST)
begin
        if(!iRST)
        mSTART        <=        0;
        else
        begin
                if(iSTART)
                mSTART        <=        1;
                if(iEND)
                mSTART        <=        0;               
        end
end

always@(posedge iCLK or negedge iRST)
begin
        if(!iRST)
        begin
                Pre_FVAL        <=        0;
                mCCD_FVAL        <=        0;
                mCCD_LVAL        <=        0;
                X_Cont                <=        0;
                Y_Cont                <=        0;
        end
        else
        begin
                Pre_FVAL        <=        iFVAL;
                if({Pre_FVAL,iFVAL}==2'b01)
                mCCD_FVAL        <=        0;
                else if(({Pre_FVAL,iFVAL}==2'b10)&& mSTART)
                mCCD_FVAL        <=        1;
               
                mCCD_LVAL        <=        iLVAL;
               
                if(mCCD_FVAL)
                begin
                        if(mCCD_LVAL)
                        begin
                                if(X_Cont<1279)
                                X_Cont        <=        X_Cont+1;
                                else
                                begin
                                        X_Cont        <=        0;
                                        Y_Cont        <=        Y_Cont+1;
                                end
                        end
                end
                else
                begin
                        X_Cont        <=        0;
                        Y_Cont        <=        0;
                end
        end
end

always@(posedge iCLK or negedge iRST)
begin
        if(!iRST)
        Frame_Cont        <=        0;
        else
        begin
                if( ({Pre_FVAL,iFVAL}==2'b10) && mSTART )
                Frame_Cont        <=        Frame_Cont+1;
        end
end


always@(posedge iCLK or negedge iRST)
begin
        if(!iRST)
        begin
                mCCD_DATA1        <=        0;
                mCCD_DATA2        <=        0;
        end
        else if(iLVAL)
                begin
                        if(!X_Cont)
                                mCCD_DATA1        <=        iDATA;
                        else if(X_Cont)
                                mCCD_DATA2        <=        iDATA;
                end
        else
                begin
                        mCCD_DATA1        <=        0;
                        mCCD_DATA2        <=        0;
                end
end       


endmodule

pocker5200 发表于 2012-6-22 17:49:18

实在抱歉,水平有限,实在看不懂这代码的功能……有些信号和截图里的信号似乎对不上。
坐等楼下高人出现。
页: [1]
查看完整版本: 图像采集求助