Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

Output Grayscale Image through VGA in DE1

I am trying to make a project wherein I will capture an image thru DE1 D5M camera module and then convert the image to grayscale then show the ouptut thru VGA in a monitor. How can I do this? I mean, can I store the converted image to SDRAM then from there can I output it to VGA? Help please. I'm not familiar how SDRAM works in the DE1.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I tired to edit the DE1_D5M code given by altera. From there, I wanted to convert the RGB image to grayscale from a separate module and then output it to VGA.

    Part of my top module is here:

    
    assign DISP_R = SW ? GrayscaleR  : VGA_out_R;
    assign DISP_G = SW ? GrayscaleG  : VGA_out_G;
    assign DISP_B = SW ? GrayscaleB  : VGA_out_B;                                
    // RGB
    assign  VGA_out_R  = Read_DATA2;
    assign  VGA_out_G  = {Read_DATA1,Read_DATA2};
    assign  VGA_out_B  = Read_DATA1;
    // Gray
    assign  GrayscaleR  = VGA_out_G;
    assign  GrayscaleG  = VGA_out_G;
    assign  GrayscaleB  = VGA_out_G;
    assign    VGA_CTRL_CLK=    rClk;
    assign    VGA_CLK        =    ~rClk;
    always@(posedge CLOCK_50)    rClk    <=    rClk+1;
    wire        oVGA_R;
    wire        oVGA_G;
    wire        oVGA_B;
    assign    VGA_R        =    oVGA_R;
    assign    VGA_G        =    oVGA_G;
    assign    VGA_B        =    oVGA_B;
    always@(posedge CCD_PIXCLK)
    begin
        rCCD_DATA    <=    CCD_DATA;
        rCCD_LVAL    <=    CCD_LVAL;
        rCCD_FVAL    <=    CCD_FVAL;
    end
    VGA_Controller        u1    (    //    Host Side
                                .oRequest(Read),
                                .iRed(DISP_R),
                                .iGreen(DISP_G,
                                .iBlue(DISP_B),
                                //    VGA Side
                                .oVGA_R(VGA_R),
                                .oVGA_G(VGA_G),
                                .oVGA_B(VGA_B),
                                .oVGA_H_SYNC(VGA_HS),
                                .oVGA_V_SYNC(VGA_VS),
                                //    Control Signal
                                .iCLK(VGA_CTRL_CLK),
                                .iRST_N(DLY_RST_2)
                           &nbsp;);
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I want to clarify that in the VGA_Controller macrofunction, the output that will be shown will be based on the VGA side?